First, we will generate a private key and a public key on our local machine using OpenSSL. Then, we will upload our public key into AWS. After that, we will specify the key pair while launching an EC2 instance. Finally, we will SSH into the instance using our private key.