SSH Key Pairs

We discuss creating and using SSK Key Pairs in AWS so we can SSH into our instances.

You can also security connect to a server in a private subnet as outlined here.

Essentially you use an SSH Agent and forward the authentication agent when SSH'ing into a public instance. It looks a bit like this:

1# List keys in the agent
2ssh-add –L
4ssh-add -K ~/.ssh/your-private-key.pem
6# Get into the bastion host, use the -A flag
7# to forward the authentication agent
8ssh -A [email protected]<ip-address>
10# From within the public-network server, ssh into a private
11# server, which works as our private ssh key was forwarded
12# into the ssh agent on the public network server
13ssh [email protected]<private-network-ip>

Don't miss out

Sign up to learn when new content is released! Courses are in production now.