Repost address: http://www.cnblogs.com/sleeper-qp/archive/2013/03/20/2971899.html
This is the problem when I ssh localhost
I searched for the solution on the Internet, and tried various methods including reinstalling ssh, but it still doesn't work.
Finally, honestly look at /var/log/auth.log
error display
error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open. error: It is recommended that your private key files are NOT accessible by others. error: This private key will be ignored. error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key error: Could not load host key: /etc/ssh/ssh_host_dsa_key error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: Permissions 0777 for '/etc/ssh/ssh_host_rsa_key' are too open. error: It is recommended that your private key files are NOT accessible by others. error: This private key will be ignored. error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key error: Could not load host key: /etc/ssh/ssh_host_rsa_key error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ error: Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open. error: It is recommended that your private key files are NOT accessible by others. error: This private key will be ignored. error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Then modify the corresponding permissions
I changed it to chmod 700 /etc/ssh/ssh_host_dsa_key
Others are similar. .