ssh keeps asking for password even though I copied my key
Trying to log in to the school's little server. I used ssh-copy-id, and it said one key added. It still asks me for a password every time.
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
2 replies
Nearly always permissions. On the server:
chmod go-w ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sshd ignores the file if your home directory is group-writable. ssh -v on your side will show whether it tried the key at all, and /var/log/auth.log on the server gives the reason.
It was the home directory, it was group writable. auth.log said "bad ownership or modes". Amazing that it just tells you. Thank you