Based on http://travisjeffery.com/b/2015/11/ssh-into-ec2-instances-by-instance-id/
If you use VPCs, you'll probably need to adjust the --filter
in the second aws ec2 describe-instances
.
You may want to add -A
to both of the ssh $ip
, or maybe just alias ec2-ssh='ec2-ssh -A'
.