Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have git successfully installed on one of our Red Hat Linux 5 WS servers, and am using it on our Intranet, not outside our firewall.

Currently, I am prompted for a password when I connect, so what steps do I need to take to make sure the server has the correct keys to avoid prompting for a password? I believe this is an issue of making sure the public keys are present. I'm just not sure how to set that up.


share|improve this question

3 Answers 3

up vote 1 down vote accepted

Make a keypair, and then copy the public key to the server:


ssh-keygen -t dsa
ssh-copy-id -i ~/.ssh/id_dsa user@remotehost
share|improve this answer
ssh-copy-id on RHEL 5? –  Peter Aug 21 '12 at 19:14
@Peter Do you have a question? –  Michael Hampton Aug 21 '12 at 19:19
Still being prompted for password after logging out and back in. –  octopusgrabbus Aug 21 '12 at 19:50

OK, it's easy. A is the client, B is the target machine. You login on A with your credentials. You generate the ssh key (if you do have it, ignore that step):

ssh-keygen -t dsa

Defaults are OK. You know have a file ~/.ssh/id_dsa and a ~/.ssh/ Login on B and execute the commands:

mkdir ~/.ssh
chmod 700 ~/.ssh

Go on A again and scp the key file:

scp ~/.ssh/ <username_b>@B:~/.ssh/authorized_keys

where is the username of B. Go on B and execute the command:

chmod 600 ~/.ssh/authorized_keys

Now, you should be OK.

share|improve this answer

Check the /etc/ssh/sshd_config file that the option

PubkeyAuthentication yes is set.

Also, I forgot to answer if you try with the root account. In that case, you need to setup the option PermitRootLogin as

PermitRootLogin without-password

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.