Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC2: broken ssh-tunneling with NixOs 17.09 #1061

Closed

Conversation

amemni
Copy link
Contributor

@amemni amemni commented Dec 9, 2018

It seems like StrictHostKeyChecking option "accept-new" only works for newer OpenSSH versions (I think 7.5) thus using it brakes ssh-tunneling for NixOs 17.09 and earlier. I propose to use a check on (builtins.substring 0 5 lib.nixpkgsVersion) to have that only for NixOs 18.03 and later, even though it's said insecure per #696 (a user will still has the option to upgrade OpenSSH or NixOs).

This was tested with NixOs 17.09:
[root@ip-172-30-2-217:~]# cat /nix/store/7j38b3hmxzk60naxiqsdk583wj9inpzg-unit-script/bin/ssh-tunnel-stage-start #! /nix/store/jgw8hxx7wzkyhb2dr9hwsd9h2caaasdc-bash-4.4-p12/bin/bash -e ssh -i /root/.ssh/id_charon_vpn -x -o StrictHostKeyChecking=no -o PermitLocalCommand=yes -o ServerAliveInterval=20 -o LocalCommand='ip addr add 192.168.105.3/32 peer 192.168.105.4 dev tun10004 && ip link set tun10004 up' -w 10004:10003 stage-unencrypted -p 22 'ip addr add 192.168.105.4/32 peer 192.168.105.3 dev tun10003 && ip link set tun10003 up' [root@ip-172-30-2-217:~]# nixos-version 17.09.git.2169304 (Hummingbird) [root@ip-172-30-2-217:~]# ssh -V OpenSSH_7.5p1, OpenSSL 1.0.2o 27 Mar 2018 [root@ip-172-30-2-217:~]#

, also with NixOs 18.03:
[root@ip-172-30-2-217:~]# cat /nix/store/ljj30m8cln55fib9gqr7bva8bygzyznz-unit-script/bin/ssh-tunnel-stage-start #! /nix/store/lw7xaqhakk0i1c631m3cvac3x4lc5gr5-bash-4.4-p12/bin/bash -e ssh -i /root/.ssh/id_charon_vpn -x -o StrictHostKeyChecking=accept-new -o PermitLocalCommand=yes -o ServerAliveInterval=20 -o LocalCommand='ip addr add 192.168.105.3/32 peer 192.168.105.4 dev tun10004 && ip link set tun10004 up' -w 10004:10003 stage-unencrypted -p 22 'ip addr add 192.168.105.4/32 peer 192.168.105.3 dev tun10003 && ip link set tun10003 up' [root@ip-172-30-2-217:~]# nixos-version 18.03.git.a18112a (Impala) [root@ip-172-30-2-217:~]#

@aszlig
Copy link
Member

aszlig commented Dec 15, 2018

Hm, this brings us to the question of whether we want to support NixOS versions older than 18.03.

@edolstra, @rbvermaa: What is the consensus on that?

Personally, I'd opt against adding backwards-compatibility for NixOS releases older than the two recent ones. After all if people want to use older releases, they could use an older NixOps.

@amemni
Copy link
Contributor Author

amemni commented Dec 15, 2018

In our case, we wanted to benefit from certain bug fixes coming out with NixOps 1.6.1 (support of NVMe, GCE labelling and routes, deploying with a large number of keys ..). Also, upgrading NixOs to most recent versions could sometimes be painful in production, especially having to do that for a big number of deployments at a time. Thanks.

@domenkozar
Copy link
Member

Maybe bump openssh in NixOS 18.03?

@aszlig
Copy link
Member

aszlig commented Jan 9, 2019

@domenkozar: You mean 17.09?

@amemni amemni force-pushed the fix-StrictHostKeyChecking-olderOpenSSH branch from 29b1bef to 234f04d Compare January 10, 2019 15:54
@amemni amemni changed the title StrictHostKeyChecking option "accept-new" only works for newer OpenSSH versions thus brakes ssh-tunneling for NixOs 17.09 EC2: broken ssh-tunneling with NixOs 17.09 Jan 10, 2019
@amemni amemni closed this Jan 24, 2019
@amemni amemni deleted the fix-StrictHostKeyChecking-olderOpenSSH branch January 24, 2019 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants