AWS Certified Cloud Practitioner

Sign Up Free or Log In to participate!

Connect to EC2 Instance

Could someone please explain connecting to an EC2 instance via SSH? You generate a key pair. But I don’t understand how this proves my identity. Moreover, I don’t know what either "SSH uses the private key" or "EC2 instance uses the public key" mean. Thanks.


You key pair has two parts (private and public). The public part of your key is stored on EC2 instance associated with a user. When connecting through SSH, the instance controls the public part of the key and then you shall provide the private part of the key to decode the encrypted connection. As a note: public and private parts of the key exist in the same file in case you use tools like putty for connection. Different tools may accept different formats of keypairs.

1 Answers

A Private key is a key that is associated to you as the user, you must keep this secured safely and encypted. A private key can decrypt a message from a server and send it back for verification. A public key is used to encrpyt a message from the server and send it to the client (e.g. you the user). I hope this helps answer your question but there are a lot if links online that you can look at as well about SSH keys.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?