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