Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to set up Git over SSH and have followed the guides I've seen to the letter. I use ssh-keygen to create a key set, log into the remote host and append the public key to .ssh/authorized_users using cat >> .ssh/authorized_keys. When I try to log in, I still get prompted for the user's (git user) password.

I also found a tutorial that showed how to use putty's keygen tool and followed that. Again, nothing. No variation of any tutorial I've found seems to get sshd on the remote host to allow me to log in with the generated key.

Is there any way to manually control this? I'm stuck on Red Hat Enterprise Linux 4 for now.

share|improve this question
post the output of ssh -v -v ......... (that's 2 -v's) – EightBitTony Apr 17 '12 at 13:54
All else being equal, running restorecon -R -v /root/.ssh on the server side (not the connecting client) made a difference. – ADTC Dec 11 '15 at 12:44
up vote 2 down vote accepted

If you have access to the SSHd configuration you can check if PubkeyAuthentication is set to yes to allow public key authentication. If PubkeyAuthentication is set to no you will not be able to login with your public key and the server will prompt you for your password.

share|improve this answer

Make sure permissions are correct:

$ chown <user> -R ~<user>/.ssh
$ chmod 700 ~<user>/.ssh
$ chmod 600 ~<user>/.ssh/authorized_keys
share|improve this answer
Mine are aq bit more lax than that and still work - but this is probably a better idea! – Tom Newton Apr 17 '12 at 13:12

Check the permissions on the authorized_keys file - 640 should be about right. SSH can be (rightly) picky about perms on these files and the .ssh directory which should be 755 at worst.

share|improve this answer

Did you check this setting in sshd_config?

PubkeyAuthentication yes

Also check the permissions on .ssh and the private key .ssh needs to be 700 and the key 600.

share|improve this answer

Check for AuthorizedKeysFile in /etc/ssh/sshd_config. Perhaps it is specifying an alternate location. The server's auth.log should tell you the reason for the authentication failure. root access required.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.