On Mon, 2021-08-30 at 10:08 +1000, Damien Miller wrote:
> Hi,
> 
> RSA/SHA1, a.k.a the "ssh-rsa" signature type is now disabled by default
> in OpenSSH.
> 
> While The SSH protocol confusingly uses overlapping names for key and
> signature algorithms, this does not stop the use of RSA keys and there
> is no need to regenerate "ssh-rsa" keys - most servers released in the
> last five years will automatically negotiate the use of RSA/SHA-256/512
> signatures.
> 
> This has been coming for a long time, but I do expect it will be
> distruptive for some people as there are likely to be some devices
> out there that cannot be upgraded to support the safer algorithms.
> 
> In these cases, it is possible to selectively re-enable RSA/SHA1
> support by specifying PubkeyAcceptedAlgorithms=+ssh-rsa in the
> ssh_config(5) or sshd_config(5) for the endpoint.
> 
> Please report any problems here, to bugs@ or to openssh@
> 
> Thanks,
> Damien
> 
Just did an update to the latest snapshot and this breaks connection
to one of the older hosts I still need to connect to from time to time.

Reverting this diff fixes the issue for me.

According to -G it should work:

$ ssh -G -oPubkeyAcceptedAlgorithms=ssh-rsa 10.255.3.242 | grep -i 
PubkeyAcceptedAlgorithms    
pubkeyacceptedalgorithms ssh-rsa

But when trying it for real I get the following:
martijn$ ssh -vvvv -oPubkeyAcceptedAlgorithms=ssh-rsa x.x.x.x
OpenSSH_8.7, LibreSSL 3.4.0
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname x.x.x.x is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> 
'/home/martijn/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> 
'/home/martijn/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: Connection established.
debug1: identity file /home/martijn/.ssh/id_rsa type 0
debug1: identity file /home/martijn/.ssh/id_rsa-cert type -1
debug1: identity file /home/martijn/.ssh/id_dsa type -1
debug1: identity file /home/martijn/.ssh/id_dsa-cert type -1
debug1: identity file /home/martijn/.ssh/id_ecdsa type -1
debug1: identity file /home/martijn/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/martijn/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/martijn/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/martijn/.ssh/id_ed25519 type -1
debug1: identity file /home/martijn/.ssh/id_ed25519-cert type -1
debug1: identity file /home/martijn/.ssh/id_ed25519_sk type -1
debug1: identity file /home/martijn/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/martijn/.ssh/id_xmss type -1
debug1: identity file /home/martijn/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 
Debian-5ubuntu1.9
debug1: compat_banner: match: OpenSSH_5.9p1 Debian-5ubuntu1.9 pat OpenSSH_5* 
compat 0x0c000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to x.x.x.x:22 as 'martijn'
debug3: record_hostkey: found key type RSA in file 
/home/martijn/.ssh/known_hosts:4
debug3: load_hostkeys_file: loaded 1 keys from x.x.x.x
debug1: load_hostkeys: fopen /home/martijn/.ssh/known_hosts2: No such file or 
directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or 
directory
debug3: order_hostkeyalgs: prefer hostkeyalgs: 
rsa-sha2-512-cert-...@openssh.com,rsa-sha2-256-cert-...@openssh.com,rsa-sha2-512,rsa-sha2-256
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: 
curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-
sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: 
rsa-sha2-512-cert-...@openssh.com,rsa-sha2-256-cert-...@openssh.com,rsa-sha2-512,rsa-sha2-
256,ssh-ed25519-cert-...@openssh.com,ecdsa-sha2-nistp256-cert-...@openssh.com,ecdsa-sha2-nistp384-cert-...@openssh.com,ecdsa-sha2-nistp521-cert-...@openssh.com,sk-ssh-ed25519-cert-...@openssh.com,s
k-ecdsa-sha2-nistp256-cert-...@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25...@openssh.com,sk-ecdsa-sha2-nistp...@openssh.com
debug2: ciphers ctos: 
chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com
debug2: ciphers stoc: 
chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com
debug2: MACs ctos: 
umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-
sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: 
umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-
sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,z...@openssh.com,zlib
debug2: compression stoc: none,z...@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: 
ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-
group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: 
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: ciphers stoc: 
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: MACs ctos: 
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: 
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,z...@openssh.com
debug2: compression stoc: none,z...@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: (no match)
Unable to negotiate with x.x.x.x port 22: no matching host key type found. 
Their offer: ssh-rsa,ssh-dss

Same difference when using -oPubkeyAcceptedAlgorithms=+ssh-rsa, or
placing it in the ssh_config(5).

Reply via email to