Load key "key1234.pem": Permission denied ec2-user@13.126.141.194: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

0 votes

Hi Guys,

I am trying to do SSH in my AWS instance. But I am getting this below error.

F:\Downloads>ssh -l ec2-user 13.126.141.194 -i key1234.pem
The authenticity of host '13.126.141.194 (13.126.141.194)' can't be established.
ECDSA key fingerprint is SHA256:nQdC5GCulBGn4/6L4U0ZwM6P8LVqN9/SuQxtONA8UtY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '13.126.141.194' (ECDSA) to the list of known hosts.
Load key "key1234.pem": Permission denied
ec2-user@13.126.141.194: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

How can I solve this error?

Jun 3 in AWS by akhtar
• 14,590 points
103 views

1 answer to this question.

0 votes

Hi@akhtar,

It seems you didn't set permissions to your key file. You can use the below given command from power shell.

$ $path=".\key.pem"
$icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"

Hope this will solve your error.

answered Jun 3 by MD
• 32,730 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Permission denied when I SSH access to EC2 instance

These are common reasons that can cause ...READ MORE

answered Mar 12, 2019 in AWS by Reema
282 views
0 votes
1 answer
0 votes
1 answer