SSH登录时提示Read from socket failed: Connection reset by
复制密钥另一台主机时,出现了错误:
Read from socket failed: Connection reset by peer.
到被登录主机的/var/log/auth.log查看日志:
Mar 7 12:51:59 slave01 sshd[2919]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Mar 7 12:51:59 slave01 sshd[2919]: error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ Mar 7 12:51:59 slave01 sshd[2919]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Mar 7 12:51:59 slave01 sshd[2919]: error: Permissions 0711 for '/etc/ssh/ssh_host_rsa_key' are too open. Mar 7 12:51:59 slave01 sshd[2919]: error: It is required that your private key files are NOT accessible by others. Mar 7 12:51:59 slave01 sshd[2919]: error: This private key will be ignored. Mar 7 12:51:59 slave01 sshd[2919]: error: key_load_private: bad permissions Mar 7 12:51:59 slave01 sshd[2919]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
应该是/etc/ssh文件夹的权限问题,执行下面的操作更改权限:
# cd /etc/ssh # chmod 0644 * # chmod 0600 ssh_host_dsa_key ssh_host_rsa_key
再重新启动sshd服务,复制成功,并且可以ssh登录。
下面关于SSH相关的文章您也可能喜欢,不妨参考下:
相关推荐
hpujsj 2020-06-14
projava 2020-11-14
WanKaShing 2020-11-12
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19