Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

I have created an IAM user and I want to connect to it using SSH. I tried using openSSH and Putty but unable to connect.

On browser logged in as root user,

First, Created a key pair: "ssh-keygen"

Second, Logged into the AWS console, Nagvigated to the IAM user that I created, and then uploaded the public key

IAM -> User -> Security Credential -> Upload ssh public key.

But when I do OpenSSH getting the below error:

 C:\Users>ssh -i "C:\Users\UserName\.ssh\id_rsa" IamUser@awspublicIp

The authenticity of host 'awspublicIp' can't be established.

ECDSA key fingerprint is SHA256:nLBtVuJWST7tf7FJGqjxaNYFGQfJw1z/5U3tOGC9byE.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'awspublicIp' (ECDSA) to the list of known hosts.

IamUser@awspublicIp: Permission denied (publickey).

Can anyone help me with this? I wanted to do SSH connect to EC2 using an IAM account instead of Root.

1 Answer

0 votes
by (12.4k points)

The pem file that you are using or adding here is actually for use within the code commit service.

Now, If you want to connect to the instance as an IAM user you have two options with you:

You can set up and connect via EC2 Instance connect and the second option would be to connect via AWS CLI using session manager. This method will be carried out by using AWS CLI to start the session from any command line.

Hope this Helps!!

Do Check out the AWS Certification Course offered by Intellipaat. 

Related questions

0 votes
1 answer
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...