General Information
Using SSH to gain access to AWS EC2 instances.
Checklist
If you generate a key pair through the Amazon console, you will download a .pem file.
You can extract just your public key and output it in RSA format that Linux authorized_keys files expect.
ssh-keygen -y -f MYKEYPAIR.pem
Accessing EC2 instances with a SSH key.
Pre-req Setup
chmod 400 keypair.pem
SSH to a system's public IP/DNS.
ssh -i keypair.pem ec2-user@public.ip.address.here
ssh -i keypair.pem centos@public.ip.address.here
SSH to a bastion host that is public facing and hopping from there to systems with private addresses only.
eval $(ssh-agent -s)
ssh-add keypair.pem
ssh -A ec2-user@public.ip.address.here
ssh -A centos@public.ip.address.here
ssh ec2-user@private.ip.address.here
ssh centos@private.ip.address.here