rootsen li
rootsen li

Reputation: 181

It is required that your private key files are NOT accessible by others, when use SSH to connect with a Azure CentOS VM

    WARNING: UNPROTECTED PRIVATE KEY FILE!          

Permissions for 'D:\Windows10\azure\azureuser.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 "D:\Windows10\azure\azureuser.pem": bad permissions [email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Upvotes: 17

Views: 28448

Answers (3)

barot harendra
barot harendra

Reputation: 11

I encountered a similar challenge with file permissions when dealing with the message:

Permissions for 'D:\Windows10\azure\maruti-key.pem' are too open.

Despite attempting to restrict access to the file exclusively to the intended user, the issue persisted even after employing methods such as adjusting security permissions and using "chmod" commands.

After troubleshooting, I found a solution by relocating the file to a different directory (C:/) and adjusting the file path accordingly. This simple adjustment resolved the permissions error.

Upvotes: 1

DataFramed
DataFramed

Reputation: 1631

Answer for Linux/Ununtu OS:

Rerun after running following command on terminal to protect your private key.

chmod 400 name-of-your-private-key-file.pem

Note: Please note, as a security mandate, it is required to protect your private-key file from other users on your local machine.

Upvotes: 21

RamaraoAdapa
RamaraoAdapa

Reputation: 3127

WARNING: UNPROTECTED PRIVATE KEY FILE! 

This error indicates that the private key file is accessible by others.

The easy way to fix this is to change the permissions of the private key file.

You can navigate to the file location in the file explorer --> Right Click on the file and select properties --> Go to the security tab --> Click on Advanced -> Change the Owner to you, grant yourself full control and disable the inheritance. Also delete other permissions --> Click on apply to save the permissions

Upvotes: 4

Related Questions