Ssh – Managing SSH keys between EC2 instances

amazon ec2ssh

I have what seems to be a growing count of EC2 instances and all is running fine and dandy. The one problem I'm facing, however, is figuring out a strategy for SSHing between the machines. Copying over my private key to each instance is counter productive, and it works fine when I need to SSH in from my personal machine, but not when I need to SSH from machine to machine.

What are some decent strategies to tackle this problem? How are you SSHing in between your cluster of EC2 instances?

Best Answer

You use ssh-agent:

ssh-agent
ssh-add
ssh -A remote-machine

For easier use, add

Host remote-machine
ForwardAgent yes

to your ~/.ssh/config