How to SSH into EC2 Instance [Quick Steps]

SSH into EC2

I am assuming you already launched the AWS instance. Now, you may need to SSH into EC2 instance to configure your server. If you are new to AWS, you may need help connecting the EC2 instance. In this article, I am going to explain how to SSH into EC2 instances from Linux as well as from windows. So, let’s get started.

How to SSH into AWS EC2 Instance

Now, let’s take a look, how you can login via SSH from both Linux and Windows system.


  • Instance Public IP address.
  • SSH Key pair (PEM) file. PPK file for windows users only.
  • SSH username.

Connect EC2 Instance

You can access EC2 instance via AWS console or you can use SSH client to connect. If you are windows user, you have to use PuTTY to connect instance.

SSH EC2 instance from Ubuntu or any Linux based Operating System.

To access an EC2 instance from Ubuntu, log in to AWS Console and navigate to the EC2 dashboard. Under the EC2 instance dashboard, copy IP address from the instance.

Now, open terminal and change your server key pair permission need to change. To change the permission use following command.

$ chmod 400 Server_Key.pem

After changing the PEM file permission use following command to connect EC2 instance via SSH.

$ ssh -i Server_key_location [email protected]_IP

As I am using Ubuntu for demonstration, my SSH user is ubuntu. Below are the users for SSH.

Instance AMISSH Username
Amazon Linuxec2-user

SSH EC2 instance from Windows

To access an EC2 instance from a Windows machine, you have to convert pem to ppk. After converting the server key SSH into EC2 instance using PuTTY.


In this article, I have explained how to SSH into EC2 instances. If you have any doubt, feel free to comment below. Also, you can join our elite Facebook group to get direct help from me. If you like this article, please share this article on your social media handle.


Please enter your comment!
Please enter your name here