On the road again

The article shows how to use ssh-agent

The ssh-agent is a helper program that keeps track of user's identity keys and their passphrases. The agent can then use the keys to log into other servers without having the user type in a password or passphrase again. This implements a form of single sign-on (SSO).

Run ssh-agent (if needed):

 eval `ssh-agent -s`

Add keys to ssh agent from local machine:

ssh-add

The command above  when run without arguments, it adds the files ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/identity.

Add key from another file:

ssh-add /home/user/devcloud.key

Pass identities from ssh agent into ssh session:

ssh -l ubuntu IP_ADDRESS -i /home/user/some.key -A

The vital option is "-A" which enables forwarding of the authentication agent connection.

Add comment