I need a user with more than one key-pair for SSH. Is that possible? Is that possible without having to specify which key to use on each command?

link|improve this question

feedback

1 Answer

up vote 8 down vote accepted

You can have multiple SSH keys (multiple identities). To use the at the command line add a -i option, e.g.

ssh -i .ssh/id_dsa_host_1 host_1

If you have a key for each server you can add the info in the .ssh/config file (see man ssh_config for details), e.g.

Host host_1
IdentityFile ~/.ssh/id_dsa_host_1

Host host_2
IdentityFile ~/.ssh/id_dsa_host_2
link|improve this answer
1  
ssh-agent can also be used to add multiple keys. – Warner Mar 24 '10 at 13:30
feedback

Your Answer

 
or
required, but never shown

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