错误:
使用SSH Secure Shell 工具链接远程linux服务器报错如下图:
解决方案:
编辑/etc/ssh/sshd_config文件,具体命令如下为 vi /etc/ssh/sshd_config ,在文件的末尾添加如下内容:
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,umac-64@openssh.com,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,curve25519-sha256@libssh.org
如下图:
注:添加上边内容前需要搜索文件中是否包含:Ciphers MACs KexAlgorithms 等未注释的字段,如果有先用“#”进行注释
重启ssh服务:
查看查看服务状态,inactive(不可用),active(可用),命令为:systemctl status sshd
重启服务,命令为:systemctl restart sshd
操作完以上步骤即解决问题,下边为补充的几个命令。
重新加载服务配置,命令为:systemctl reload sshd
设定服务开机启动,命令为:systemctl enable sshd
设定服务开机不启动,命令为:systemctl disable sshd
列出已经开启服务当前状态,命令为:systemctl list-units