Step 11: Access Your Instance using "ssh"Once your instance is running, go to the EC2 Dashboard, select your instance, and click the "Connect" button. You'll find instructions for both Linux and Windows connections below:
Connecting from Mac and Linux:- Open a terminal on your local machine.
- Navigate to the directory where you saved your private key file (.pem).
- Use the "chmod" command to set the appropriate permissions on the key file:
chmod 400 <your-key-file>.pem.
- Copy the SSH command from the EC2 instance connect page.
- Paste the command into your terminal and press Enter
Connecting from Windows:- Download and install an SSH client such as PuTTY.
- Convert your .pem key file to a .ppk key file using PuTTYgen.
- Open PuTTY and enter the public IP address of your instance in the "Host Name" field.
- Load your .ppk key file in the "Connection > SSH > Auth" settings.
- Click "Open" to start the SSH session.
Step 13: Access Your Instance using "AWS Session Manager"You can access now the instance through the AWS console using Session Manager.
This provides a browser-based session similar to EC2 Instance Connect, eliminating the need to open port 22.