Super User is a question and answer site for computer enthusiasts and power users. 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

Basically, as it comes from the title, I'd like to login from my workstation to a SSH server by using different account in different shells. What I'd like to do is to backup all my account from this server to my hard drive by using rsync, but as you know rsync can get a connection if the keys have been generated.

I have already an account set with key for login without pass. What I did was to generate a key on the server and then download it on my ~/.ssh folder. I tried it with another account and I chanced the name of the key. Then I download it in my ~/.ssh...but no way to get it work.

I am not an expert of this stuff. If you would provide any tips or way to set it up I would really appreciate your help.


share|improve this question

migrated from Jun 18 '12 at 14:34

This question came from our site for professional and enthusiast programmers.

By default, SSH looks for keys with specific names, namely ~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/id_ecdsa. If your key is named something else, SSH won't find it unless you tell it about it. There are two ways to go about this.

The first is to use the SSH client configuration file. Use a Host line to match the server's hostname, and then set IdentityFile appropriately. For example:

    IdentityFile ~/.ssh/id_rsa-server1

    IdentityFile ~/.ssh/id_rsa-server2

The second option is to specify the key in the rsync command. To do this you need to use the -e parameter to tell rsync what transport to use. This would look something like this:

rsync -e 'ssh -i ~/.ssh/id_rsa-server1' ~/server1/
share|improve this answer

You must log in to answer this question.