To log on to the instance, we need the username, the ssh key, and the hostname.

The username is ec2-user.

The ssh key is the one chosen when the instance was created. For this example we've used the key key_name with the private key located at $HOME/.ssh/key_name.pem.

The hostname is the PublicDNS of the instance.

Console - user@hostname ~ $

ssh -i $HOME/.ssh/key_name.pem ec2-user@PublicDNS