How to avoid Permission denied (publickey) SSH key (Windows)
Solution 1
If permissions are too open for your private SSH key (regardless of OS) you will not be able to use the key.
Generally it should be as low permission as possible (Read only by your user only), at minimum on Windows you should be able to remove all other users permissions which will allow the key to be loaded.
Solution 2
This is the method worked for me
Step 1
Right click the Key file first1.pem
on explorer and Go to Properties > Security > Advanced > Disable Inheritance
Step 2
Select "Convert inherited permissions into explicit permissions on this object"
Step 3
Then delete everything there ( Including Administrator, User, User Groups ) and Click Add button.
Step 4
Now select select a principal > Advanced > Find Now > [ Your User object ] > OK
Step 5
Now you can tick "Full Control" then press OK
Now your key file is not accessible by others. This is the only method worked for me. Hope it helps. Thank You.
Related videos on Youtube
Sevval Kahraman
Updated on June 04, 2022Comments
-
Sevval Kahraman almost 2 years
I want to connect my ec2 with SSH. But i get this error :
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions for 'F:\\Config\\first1.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 "F:\\Config\\first1.pem": bad permissions [email protected]: Permission denied (publickey).
How can i solve this problem on Windows?
-
Barak Friedman over 3 yearsYou need to make sure the file has no read permission to any other user, You can do this by opening the file's permissions dialog and make sure only your user has read access. No write access, byw.
-
stdunbar over 3 yearsDoes this answer your question? OpenSSH using private key on Windows ("Unprotected private key file" error)
-
-
Sevval Kahraman over 3 yearsNow it says : Load key "F:\\Config\\first1.pem": Permission denied
-
John Rotenstein over 3 yearsSounds like you removed too much permission. See: Windows SSH: Permissions for 'private-key' are too open
-
Shankara Narayana over 2 yearsi believe you cacn addd the images into your answer directly.
-
Tono Nam about 2 yearsThanks I finally managed to do this on windows. In Linux this can be done with just
chmod 700 {filePath}
. Windows makes this so complicated.