can't login by ssh aftcher chmod on home folder

时间:2016-10-20 18:38:25

标签: ssh google-compute-engine

I've done a chmod 777 on my home folder, where the .ssh folder is, and now I cannot login. I've restored permission on all files but still cannot login. Should I change anything in order to be able to login again.

I get this message: Server refused our key On other servers I can login properly.

Thank you.

2 个答案:

答案 0 :(得分:2)

ssh rejects key-based logins if permissions allow other people to tamper with your authorized_keys file. You need to check /, /home, /home/yourname, /home/yourname/.ssh and /home/yourname/.ssh/authorized_keys. All of those must not be group or world writeable.

答案 1 :(得分:-1)

Typically you want the .ssh directory permissions to be 700 (drwx------) and the public key (.pub file) to be 644 (-rw-r--r--). Your private key (id_rsa) should be 600 (-rw-------).

Stolen from: Permissions on private key in .ssh folder?