Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to set password-less logins to my desktop from my server so that a bash script on the server could scp backups over to the desktop. The desktop is running Kubuntu 12.10, and the server is running some Redhat derivative. My desktop's IP address does not change (not on the big bad internet, and not on the LAN). I can SSH in from the server to the desktop just fine:

[remote]$ ssh backup@my-ip-address
backup@my-ip-address's password:
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-25-generic x86_64)
...
[dotandesktop]$ exit
Connection to my-ip-address closed.
[remote]$

I have scped the .ssh/id_rsa.pub file from the remote server to the desktop. I then cated the file into the desktop's .ssh/authorized_keys key file with the >> append operator. I believe that I have the correct permissions for everything on the desktop:

[dotandesktop]$ sudo ls -la | grep  .ssh
drwx------ 2 backupuser backupuser 4096 Apr  7 13:01 .ssh
[dotandesktop]$ ls -la .ssh
total 12
drwx------ 2 backupuser backupuser 4096 Apr  7 13:01 .
drwxrwxr-x 7 backupuser backupuser 4096 Apr  7 13:58 ..
-rw------- 1 backupuser backupuser 1211 Apr  7 13:58 authorized_keys

And on the server:

[remote]$ ls -la | grep .ssh
drwx------ 2 fschafer fschafer     4096 Apr  7 04:05 .ssh
[remote]$ ls -la .ssh
total 24
drwx------ 2 fschafer fschafer 4096 Apr  7 04:05 .
drwx--x--x 4 fschafer fschafer 4096 Apr  7 06:05 ..
-rw------- 1 fschafer fschafer 1608 Feb 25 04:51 authorized_keys
-rw------- 1 fschafer fschafer 1675 Apr  7 04:05 id_rsa
-rw-r--r-- 1 fschafer fschafer  405 Apr  7 04:05 id_rsa.pub
-rw-r--r-- 1 fschafer fschafer  791 Apr  7 04:40 known_hosts
[remote]$ 

Additionally, from my SSH config file:

[dotandesktop]$ cat /etc/ssh/sshd_config | grep "RSAAuthentication\|PubkeyAuthentication"
RSAAuthentication yes
PubkeyAuthentication yes
RhostsRSAAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication

However, when I try to SSH into the desktop from the server, it still asks me for my password. What else should I check?

share|improve this question
    
Did you create a ssh key with a passphrase? –  André Stannek Apr 7 '13 at 14:13
    
No, no passphrase! –  dotancohen Apr 7 '13 at 16:48

1 Answer 1

You did it the wrong way. You need the private key on the client and the public key on the server in the authorized_keys file.

Edit from Oli: I'll add that you'd do yourself a ton of favours by just using the toolset provided for you.
Namely: ssh-copy-id

share|improve this answer
    
I'm trying to SSH in from the server to the desktop in order to move server backups to the desktop. –  dotancohen Apr 7 '13 at 13:15
    
I just tried with ssh-copy-id (from the server to my desktop) but still, when I try to SSH into the desktop from the server I am prompted for my password. Of course, I used the -i option to select .ssh/id_rsa.pub. –  dotancohen Apr 7 '13 at 13:23
    
It's kind of confusing to use the terms server and client in that way. It doesn't make a lot of sense to copy your backup from the server to your desktop as a server is something that is hosting services and a client uses them. You should pull the backups from the server, not push them to the client. –  André Stannek Apr 7 '13 at 14:12

Your Answer

 
discard

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.