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:
chmod 400 <your-key-file>.pem
- 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:
Connecting from Windows:
- Copy the SSH command from the EC2 instance connect page.
- Paste the command into your terminal and press Enter
Step 13: Access Your Instance using "AWS Session Manager"
- 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.
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.