ssh keys and ssh-agent

If you want to run the same command on lots of lab machines, setting up your ssh keys will make that a lot easier.

If you haven't already, generate an ssh key:

$ ssh-keygen -t rsa

Accept the default file for the key and use a good passphrase!

Now add public key part to authorized_keys2 file:

$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2

And run the agent to hold your key, then test it:

$ ssh-agent bash
$ ssh-add
Enter passphrase for /home/ru1/.ssh/id_rsa: this is my secret passphrase...
Identity added: /home/ru1/.ssh/id_rsa (/home/ru1/.ssh/id_rsa)

$ ssh cinnamon
You are using 14% (5 MB) of your 40 MB quota.
cinnamon[~]$ 
cinnamon[~]$ exit
$ 

Note the ssh to cinnamon didn't require a password! So from this bash shell on this machine, I can ssh to any other lab machine without having to type my password (the ssh-agent is taking care of that for me). Next time you log in, you only need to run the ssh-agent and ssh-add commands.

Good link on ssh stuff: http://kimmo.suominen.com/docs/ssh/