Server responded “Algorithm negotiation failed“ 使用SSH Secure File Transfer Client連不上伺服器
阿新 • • 發佈:2021-01-01
Server responded “Algorithm negotiation failed” 使用SSH Secure File Transfer Client連不上伺服器
Server responded "Algorithm negotiation failed",Failed to restart ssh.service: Unit not found.
連線錯誤
原因
新買的伺服器沒有配置ssh相關檔案
解決方案
1、找到sshd_config中的# Authentication,將下變打√的註釋開啟
2、將以下內容粘到檔案末尾
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]
3、 ESC+:wq將修改的檔案儲存,然後重啟sshd服務 service ssh restart
vim /etc/ssh/sshd_config
... 下邊√的註釋開啟
# Authentication:
LoginGraceTime 2m √
PermitRootLogin yes √
StrictModes yes √
#MaxAuthTries 6
#MaxSessions 10
... 以下內容粘到檔案末尾
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]
重啟sshd失敗
Failed to restart ssh.service: Unit not found.
原因:service ssh restart是centos6裡面的命令,在centos7需要用:
systemctl restart sshd