Skip to main content

Command Palette

Search for a command to run...

AWS EC2 instance

Published
โ€ข1 min readโ€ขView as Markdown

Hey guys! ๐Ÿ‘‹

Today I have learned about the EC2 service in AWS. Damn, it's so cool! I now understand how to connect to my EC2 instance through SSH (Secure Shell). When you create an SSH key pair in AWS, it generates two different keys: one is the public key and the other is the private key.

The public key is stored on the EC2 instance, and the private key is downloaded to my local computer. So when I log in using SSH, since I have the private key, it verifies against the public key on the server and grants me authorization. This is what happens under the hood.

Off-topic:

If your public key is added to the ~/.ssh/authorized_keys file on your friend's machine, and you have the corresponding private key, then you can SSH into their system using their IP address and access the files so always check ~/.ssh/authorized_keys has any another key