查找资料并尝试各种方法,终于成功使用SSH连接上阿里云ECS了
其余的服务器都是CentOS的,唯独这个Ubuntu有那么一点点叛逆,死活连不上
最初的错误是:Too many authentication failures
第一篇:
我的重新安装了openssh-server
sudo apt remove openssh-server
sudo apt install openssh-server
在这个环节也是折腾了好一会
ssh -Q cipher
ssh -Q mac
ssh -Q kex
echo 'Ciphers' `ssh -Q cipher | paste -d, -s` >> /etc/ssh/sshd_config
echo 'MACs' `ssh -Q mac | paste -d, -s` >> /etc/ssh/sshd_config
echo 'KexAlgorithms' `ssh -Q kex | paste -d, -s` >> /etc/ssh/sshd_config
#sshd_config文件变化的地方不多
#去掉了这两行前面的注释
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#在末尾追加了三行,这三行是我通过上面命令写入的,尽量不要照搬照抄
Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
MACs hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,curve25519-sha256,curve25519-sha256@libssh.org
sudo service ssh restart
终于成功,这个问题困扰我很久了
这篇文章为后增的,解决了SSH无法连接华为云CentOS 8的问题。