К основному контенту

Сообщения

Сообщения за декабрь, 2012

Jamie Strandboge: OpenSSH and multiple identities

Jamie Strandboge: OpenSSH and multiple identities : While this may be old news to some, I only just now figured out how to conveniently use multiple identities in OpenSSH. I have several ssh keys, but only two that I want to use with the agent: one for personal use and one for work. I’d like to be able to not specify which identity to use on the command line most of the time and just use ssh like so: $ ssh <personal> $ ssh <work> $ ssh -i ~/.ssh/other.id_rsa <other> where the first two use the agent with ~/.ssh/id_rsa and ~/.ssh/work.id_rsa respectively, and the last does not use the agent. ‘man ssh_config’ tells me that the agent looks at all the different IdentityFile configuration directives (in order) and also the IdentitiesOnly option. Therefore, I can set up my ~/.ssh/config to have something like: # This makes it so that only my default identity # and my work identity are used by the agent IdentitiesOnly yes IdentityFile ~/.ssh/id_rsa Iden