google code pretty

2016-12-16

[Ubuntu] bad ssh2 cipher spec error

要使用 SSH 連線到主機時發現碰到不能連線的情形
「ssh: connect to host 10.144.xxx.xxx port 22: Connection refused」

排除網路設定與防火牆問題後,從 /ver/log/syslog 發現 SSH 根本啟動失敗,錯誤訊息如下:
Dec 16 13:18:25 localhost init: ssh main process (834) terminated with status 255
Dec 16 13:18:25 localhost init: ssh main process ended, respawning

使用 「/usr/sbin/sshd -Dd」看到「bad ssh2 cipher spec error」錯誤訊息

參考 這篇文章

修改 /etc/ssh/sshd_config,將原本的 
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
修改為
Ciphers aes256-cbc

重啟 SSH (service ssh start)
檢查 SSH 狀態 (service ssh status) 
即可正常使用 SSH 連線