Connecting to Linux EC2 Instances via SSH

Connecting to your Amazon EC2 Linux instances via SSH is a fundamental skill for managing your cloud infrastructure. Here’s a straightforward guide to help you get started with SSH access using Terminal (Mac/Linux) and PowerShell (Windows).

U…


This content originally appeared on DEV Community and was authored by Noor Fatima

Connecting to your Amazon EC2 Linux instances via SSH is a fundamental skill for managing your cloud infrastructure. Here's a straightforward guide to help you get started with SSH access using Terminal (Mac/Linux) and PowerShell (Windows).

Using SSH with Terminal (Mac/Linux)

1. Open Terminal

Launch the Terminal application from your applications menu or by searching for it.

2. Run the SSH Command

Execute the following command to connect to your EC2 instance:

ssh -i /path/to/your-key.pem ec2-user@your-ec2-public-dns

  • Replace /path/to/your-key.pem with the path to your private key file.
  • Replace your-ec2-public-dns with the public DNS of your EC2 instance.

3. Key Permissions

Ensure your private key file has the correct permissions. You may need to set the permissions using:

chmod 400 /path/to/your-key.pem

Using SSH with PowerShell (Windows)

1. Open PowerShell

Open PowerShell from the Start menu or by searching for it.

2. Run the SSH Command

Execute the following command:

ssh -i C:\path\to\your-key.pem ec2-user@your-ec2-public-dns

  • Replace C:\path\to\your-key.pem with the path to your private key file.
  • Replace your-ec2-public-dns with your EC2 instance’s public DNS.


This content originally appeared on DEV Community and was authored by Noor Fatima


Print Share Comment Cite Upload Translate Updates
APA

Noor Fatima | Sciencx (2024-07-19T05:53:03+00:00) Connecting to Linux EC2 Instances via SSH. Retrieved from https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/

MLA
" » Connecting to Linux EC2 Instances via SSH." Noor Fatima | Sciencx - Friday July 19, 2024, https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/
HARVARD
Noor Fatima | Sciencx Friday July 19, 2024 » Connecting to Linux EC2 Instances via SSH., viewed ,<https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/>
VANCOUVER
Noor Fatima | Sciencx - » Connecting to Linux EC2 Instances via SSH. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/
CHICAGO
" » Connecting to Linux EC2 Instances via SSH." Noor Fatima | Sciencx - Accessed . https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/
IEEE
" » Connecting to Linux EC2 Instances via SSH." Noor Fatima | Sciencx [Online]. Available: https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/. [Accessed: ]
rf:citation
» Connecting to Linux EC2 Instances via SSH | Noor Fatima | Sciencx | https://www.scien.cx/2024/07/19/connecting-to-linux-ec2-instances-via-ssh/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.