Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

server 1 which dials into server 2

ssh-keygen -t dsa -b 1024 (no password)
scp id_dsa.pub user@server2.com:/home/user/.ssh


[~/.ssh]# cat id_dsa.pub >> ./authorized_keys

But when I do ssh user@server2.com I get:

other-boxes-user@server2.com's password:


server1: ssh-keygen -t dsa -b 1024 (no password)
server1: ssh-copy-id -i ~/.ssh/id_dsa server2user@server2.com
server1: ssh server2user@server2.com -- get promoted for a password

How do I get the correct user used so I can login with no password?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

The permissions on the .ssh directory and/or the files within it are wrong on the remote server.

You can fix these manually yourself, or just use the ssh-copy-id utility to copy your public keys over to the server. This will also fix any broken permissions of this type.

ssh-copy-id -i ~/.ssh/id_dsa user@server2.com

If you still have trouble, you need to look at sshd debug logs on the server.

share|improve this answer

1 - Where exactly are you adding the public key id_dsa.pub? Could it be you are appending it to /root/.ssh/authorized_keys instead of in /home/user/.ssh/authorized_keys on server2? Make sure you place it in the authorized_keys of the respective user.

2 - permissions (as suggested by Michael)

chmod  700  /home/user/.ssh
chmod 600 /home/user/.ssh/authorized_keys

3 - server1: use the following command to connect.

  ssh -i /home/user/.ssh/id_dsa user@server2.com
share|improve this answer
thanks. corrected. –  Daniel t. Feb 14 '13 at 2:57

Below steps might help you

server 1 ssh-keygen -t dsa -b 1024 (no password)

scp id_dsa.pub user@server2.com:/home/user/.ssh

cat ~/.ssh/id_dsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'

chmod -R 700 /home/user/.ssh

chmod -R 600 /home/user/.ssh/authorized_keys


chmod -R 600 /home/user/.ssh/authorized_keys

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.