The ssh client handles this type of thing automagically on Linux.
Look in ~/.ssh -
user@darkstar ~/.ssh $ ls -l
total 60
-rw------- 1 user user 1692 Jun 24 2013 amazonkey.pem
-rw------- 1 user user 1696 Jul 11 2013 clark-key.pem
-rw-r--r-- 1 user user 393 Nov 23 18:47 config
-rw------- 1 user user 1675 Feb 29 2016 id_rsa
-rw-r--r-- 1 user user 393 Feb 29 2016 id_rsa.pub
-rw------- 1 user user 19690 Dec 19 20:02 known_hosts
-rw------- 1 user user 19246 Dec 11 23:59 known_hosts.old
user@darkstar ~/.ssh $
You have your various keys (the 2 .pem files are from aws, the id_rsa is my own private key) and the config file, as well as the known_hosts.
The config file is where your magic happens
Host amazoninstance
IdentityFile ~/.ssh/amazonkey.pem
HostName my.domain.name.at.amazon.com
User someusername
Port 2223
With that, all I do is
user@darkstar ~/ $ ssh amazoninstance
And it connects as specified in the config file, and provides the identity key automatically. And I'm logged in Just Like That. Need to connect to multiple servers at once? Start a screen session, or open other X terms, or new tabs in your X term client if it supports it, etc.
Note that SOME desktop environments on SOME distributions will want you to create a local keystore and password protect access to the keys in your ~/.ssh and such...
ssh-agent
in this context? AFAIR this tool caches your key/password when used for the first time. – Izzy♦ Aug 27 '16 at 9:48