How to Connect to AWS EC2 Instance by Using PuTTY Without Using .pem File?

by samcullin in Teachers > University+

1345 Views, 0 Favorites, 0 Comments

How to Connect to AWS EC2 Instance by Using PuTTY Without Using .pem File?

connection to aws instance.png

Connecting to an AWS EC2 instance without a PEM file requires exploring an alternative authentication method: using a password instead of a secure key pair. AWS EC2 instances are cloud-based virtual server that are usually accessed via SSH with a PEM file for further protection. While using passwords is less secure than using SSH keys, there are chance of unauthorized access increased. 

 


Supplies

Note:


This method work when you have running connection with AWS EC2 instance.

Enable Password Authentication on EC2 Instance

Log in to your AWS Management Console.

Go to the EC2 dashboard, Select your EC2 instance.

In the Description tab, locate the security group associated with your instance and make sure it allows inbound SSH traffic.

Connect to your EC2 instance using an existing PEM file, run command to edit the SSH configuration file:

 

sudo nano /etc/ssh/sshd_config

 

 Set PasswordAuthentication to yes.

Set Password for User

Still connected to your instance, set a password for the desired user run command:

 sudo passwd [username]

Restart the SSH Server

Restart the SSH server to make the changes effect, run command:

 sudo service ssh restart

 

Configure PuTTY

65.png

Open PuTTY configuration window, Enter the public IP or DNS of your EC2 instance in the Host Name section.

Set the connection type to SSH and port to 22.

 

Session Save

save session.png

In the Saved Sessions section and click the "Save" button to save these settings for future use.

Establish a Connection

start connectiomn.png

To start the connection, click the Open button.

Enter the username and password when prompted.


By using PuTTY you can also connect to AWS instance without using .pem file.