3

I have a server that I usually connect to from multiple laptops, some FC22, FC23, or ubuntu. I installed a brand new laptop FC23, added the relevant keys in authorized_keys, etc:

[mathieu@xps13 code]$ ssh -vvv root@ovh6
OpenSSH_7.2p2, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /home/mathieu/.ssh/config
debug1: /home/mathieu/.ssh/config line 5: Applying options for *
debug1: /home/mathieu/.ssh/config line 71: Applying options for ovh6
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "XXXXXXXXXXXXXXX" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to XXXXXXXXXXXXXXX [YYYYYYYYYYYY] port 22.
debug1: Connection established.
debug1: identity file /home/mathieu/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mathieu/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to ns427784.ip-37-187-149.eu:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
debug2: ciphers stoc: aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-128-etm@openssh.com compression: none
debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16
debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 1541/3072
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:3dFTH1Rbkf+Y4PyYWfyPFkmZoxepgsdJnKgSikaSqEs
debug3: hostkeys_foreach: reading file "/home/mathieu/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/mathieu/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from XXXXXXX
debug3: hostkeys_foreach: reading file "/home/mathieu/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/mathieu/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from 37.187.149.109
debug1: Host 'XXXXXXXXXXXX' is known and matches the RSA host key.
debug1: Found key in /home/mathieu/.ssh/known_hosts:4
debug2: bits set: 1569/3072
ssh_dispatch_run_fatal: Connection to XXXXXXXXXXXXXXX port 22: incorrect signature

More information: I can use agent forwarding to connect to this server by bouncing on another server which confirms that the client-side priv/pub authentication keys are fine. I also see that the only difference between this laptop and one that fails is the openssh version (7.1p2 = works, 7.2p2 = fails). i.e., after I run dnf update on the working laptop, it starts to fail... Reporting as a bug in fedora bugzilla. for FC23.

Now, this one eludes me: I can still connect from another FC23 laptop, what could I possibly have done wrong ?

  • can you give it a try with -vvv? There will be more messages. Is something logged on the server? This never happend to me in everyday use? Do you have updated openssh on both client and server? – Jakuje May 1 '16 at 19:40
  • Are you sure your public key file and private key file correspond is in fact a pair? Weird results can be seen if you take the public key from one pair and the private key from another pair, and try to make ssh use them as if they were a pair. – kasperd May 1 '16 at 21:06
  • yes, I am certain the priv/pub pair is correct. I use the exact same authorized_keys on another server and I can connect to it with this same damn laptop. – mathieu May 2 '16 at 6:20
  • added -vvv output – mathieu May 2 '16 at 6:22
  • Now from F23 -> F22 I can see the same behaviour with diffie-hellman-group-exchange-sha256 Key exchange. Thanks for the report. I will check what can be done. – Jakuje May 2 '16 at 7:24
3

As per the reported bug #1332082, it was a bug in openssh shipped in Fedora 22.

In short, server (openssh-6.9p1 in Fedora 22) was doing signature over different data than the client (openssh-7.2 in Fedora 23) was expecting, when using diffie-hellman-group-exchange-sha256 key exchange. The fix is already in Bodhi and on the way to Fedora 22 updates.

Thank you for the report.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.