bad permissions: ignore key: .ssh/my_private_key.pem Permission denied (publickey).

0 votes

Hi Guys,

I am trying to connect my instance using SSH, but it shows me the below error.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '.ssh/my_private_key.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: .ssh/my_private_key.pem
Permission denied (publickey).

How can I solve this error?

Apr 28 in AWS by akhtar
• 11,270 points
73 views

1 answer to this question.

0 votes

Hi@akhtar,

In your error message it shows you are using .ssh/my_private_key.pem with file permissions of 0777, which allow anyone to read or write to this file. This permission level is very insecure, and so SSH ignores this key. To fix the error, execute the following command, substituting the path for your private key file.

$ chmod 0400 .ssh/my_private_key.pem

Hope this will solve your error?

answered Apr 28 by MD
• 24,500 points

Related Questions In AWS

+1 vote
1 answer

AWS ssh access permission denied (public key issue)

For Ubuntu Instance, First, check whether you have ...READ MORE

answered May 13, 2019 in AWS by sunshine
• 1,260 points
1,513 views
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
256 views
0 votes
1 answer
0 votes
1 answer