How To Use Multiple SSH Keys? – POFTUT

How To Use Multiple SSH Keys?

I work on  Ubuntu and want to use multiple ssh keys to connect different serves. I have tried some different method but unluckily they have failed. How can I use multiple ssh keys?

Multiple Hosts Multiple Keys

Ssh config resides in .ssh/config file in user home directory. The magic is here.

Hostname cen1.example.com is the hostname of the remote system. While connecting to this system with IdentityFile ~/.ssh/cen1_rsa configuration makes to use cen1_rsa as key.

Multiple Keys Same Host

This is usefull alternative for key usage too. We want to use multiple keys for same host. As we know ssh is tries related keys for hosts in sequence. We can define new keys with Identity configuration like below

Here IdentityFile ~/.ssh/ubu1bak_rsa is added alternate private ssh for host ubu1.

 

How To Use Multiple SSH Keys? Infografic

How To Use Multiple SSH Keys? Infografic

How To Use Multiple SSH Keys? Infografic

LEARN MORE  Useful and Basic Commands For Ubuntu Linux Distribution

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)