Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 904
rootsen li Avatar asked Dec 06 '25 08:12

rootsen li


2 Answers

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.

like image 97
DataFramed Avatar answered Dec 09 '25 00:12

DataFramed


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

like image 36
RamaraoAdapa Avatar answered Dec 08 '25 23:12

RamaraoAdapa