Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laracasts2020's avatar

AWS - DevOps - I'm trying to access my private instance via public instance and getting this error WARNING: UNPROTECTED PRIVATE KEY FILE! can you please help me in it? AWS

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0664 for 'tapinssec2.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "tapinssec2.pem": bad permissions
[email protected]: Permission denied (publickey).

0 likes
2 replies
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

The error message you're seeing indicates that the permissions on your private key file are too open. SSH requires that your private key files are not accessible by others to ensure the security of your SSH connection.

To fix this issue, you need to change the permissions of your private key file so that only you can read and write to it. You can do this by running the following command in your terminal:

chmod 600 tapinssec2.pem

This command sets the permissions of the file tapinssec2.pem so that only the owner of the file (you) has read and write permissions, and no one else can access it.

After changing the permissions, you should be able to use the private key to access your private instance via your public instance without encountering the warning message.

1 like

Please or to participate in this conversation.