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.