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.

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?

share|improve this question

1 Answer 1

up vote 9 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
share|improve this answer
1  
ssh-agent can also be used to add multiple keys. –  Warner Mar 24 '10 at 13:30

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.