SSH 錯誤解決案例1:Read from socket failed: Connection reset by peer


今天早上天天連接的開發機突然報出連接錯誤。

這個錯誤是SSH最常見錯誤,造成的原因也是千奇百怪(具體可goole),下面描述我的server的問題:

客戶端報錯

[root@server]# ssh 192.168.1.22
Read from socket failed: Connection reset by peer

換個機器連接也不行,嘗試重啟server端的sshd,thanks god, 報錯了

[root@GMTDev ssh]# service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/etc/ssh/ssh_host_dsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
                                                           [  OK  ]

 先解決這個錯誤吧

chmod 600 /etc/ssh/*key*

service sshd restart

 按理說,只有我自己用這個機器,不知道為什么權限莫名報錯。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM