# 古いsshdへの接続 SHA-1 ハッシュアルゴリズムに脆弱性が見つかって、最新の Open SSH はデフォルトで SHA-1 を無効化した影響で、古いSSHサーバに最近のSSHクライアントから接続しようとすると繋がらないことがある。具体的には、下記のようなエラーが発生する。 {{{ $ ssh user@hostname Unable to negotiate with xxx.xxx.xxx.xxx port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss }}} ## 解決方法 クライアント側のsshdにssh-rsaを許可する設定を追加すれば、良い ### /etc/ssh/ssh_config.d/10-allow-oldssh.conf {{{ Host * HostkeyAlgorithms +ssh-rsa PubkeyAcceptedAlgorithms +ssh-rsa }}} ## Rocky/AlmaLinux/RHEL RedHatでは更に上記の対応をしても、次のようなエラーがでる。 {{{ $ ssh user@hostname ssh_dispatch_run_fatal: Connection to xxx.xxx.xxx.xxx port 22: error in libcrypto }}} 暗号化ポリシーをSHA1に変更すれば正しく動作するようになる。 {{{ $ update-crypto-policies --set DEFAULT:SHA1 }}}