How do I ssh without a password (setting up ssh keys doesn't work)?

3

0

I want to ssh, scp, git fetch, etc. without a password. I saw the previous questions, and closed ones regarding this issue, but the suggestion seems to be to use ssh keys. However, after setting up ssh keys, I am still asked for my password (it's not asking for my private key password; it's asking for my login password). How am I supposed to set this up so that it only uses my private key for authentication?

jonderry

Posted 2011-03-09T19:39:39.950

Reputation: 837

Answers

5

Set the permissions on ~/.ssh (0700) and its contents (0600) on both the client and server appropriately.

Ignacio Vazquez-Abrams

Posted 2011-03-09T19:39:39.950

Reputation: 100 516

4

ssh is paranoid about ownership of the authorized_keys file. It is possible for someone other than root to change the file, then it won't use it. It check the whole directory tree, so if it is possible for someone to do something like replace your home directory or your .ssh directory it will not use it. Check the permissions from authorized_keys all the way down to /. None of these should be group or world writable without the sticky bit set. (Permissions on my /home directory is drwxrwxr-t. Ownership must be root or the user. Permissions on authorized_keys itself should not allow access by group or world.

Testing with ssh -v instead of ssh should help. Using ssh-copy-id to copy the key to the remote system is a good idea.

BillThor

Posted 2011-03-09T19:39:39.950

Reputation: 9 384