I've OpenSSH 7.6 installed in Windows 7 for testing purposes. SSH client & server work just fine till I tried to access one of my AWS EC2 box from this windows. Show It seems like I need to change the permission on the private key file. This can be easily done on unix/linux with What about windows? private-key.ppm is copied directly from AWS and I guess the permission too.
asked Feb 18, 2018 at 5:10
11 You locate the file in Windows Explorer, right-click on it then select "Properties". Navigate to the "Security" tab and click "Advanced". Change the owner to you, disable inheritance and delete all permissions. Then grant yourself "Full control" and save the permissions. Now SSH won't complain about file permission too open anymore. It should end up looking like this:
MSC 5571 gold badge5 silver badges13 bronze badges answered Feb 18, 2018 at 8:57
iBugiBug 9,2967 gold badges34 silver badges64 bronze badges 21 Keys must only be accessible to the user they're intended for and no other account, service, or group.
answered Jun 8, 2018 at 15:34
22 In addition to the answer provided by ibug. Since i was using the ubuntu system inside windows to to run the ssh command. It still was not working. So i did
and then it worked answered Sep 8, 2018 at 13:27
Parv SharmaParv Sharma 6835 silver badges5 bronze badges 9 I had a similar issue but I was at work and don't have the ability to change file permissions on my work computer. What you need to do is install WSL then copy the your key to the hidden ssh directory in WSL:
Now you should be able to modify the permissions normally.
Then ssh using WSL:
Giacomo1968 50.3k18 gold badges158 silver badges203 bronze badges answered Sep 6, 2019 at 18:17
JKauffmanJKauffman 5514 silver badges2 bronze badges 5 You just need to do at least four things:
Matthew Lock 4,6012 gold badges34 silver badges42 bronze badges answered Feb 16, 2019 at 21:58
3 use below command on your key it works on windows
answered Oct 4, 2019 at 13:28
4 This seems to be related to the version of OpenSSH you're running:
When running
answered Apr 5, 2018 at 11:53
Rich SRich S 3332 silver badges7 bronze badges 6 You can use
answered Aug 12, 2019 at 12:39
manjuvmanjuv 1071 silver badge3 bronze badges 4
answered Apr 17, 2020 at 19:34
2
Here's the way to do it using Microsoft's tooling, avoiding the problem from the get-go. But it should also fix the issue, meaning you can follow these instructions with existing keys. Start PowerShell/Terminal as Administrator and run the following:
answered Oct 30, 2020 at 14:31
Louis WaweruLouis Waweru 23.2k37 gold badges128 silver badges193 bronze badges 2 A single line in CMD might do the trick; as described
here, adding the key from
To check key has been added:
answered Nov 28, 2019 at 14:45
majommajom 1112 bronze badges This is just a scripted version of @JW0914's CLI answer, so upvote him first and foremost:
answered Oct 3, 2019 at 21:07
bbarkerbbarker 3063 silver badges9 bronze badges I couldn't get any of these answers working for me due to permission issues, so I'll share my solution:
answered Feb 24, 2020 at 23:03
7
answered Mar 14, 2020 at 15:15
1 Answer by iBug works fine! You can follow that and get rid of this issue. But there are few things which are needed to be cleared as I faced issues during setting up permissions and it took few minutes for me to figure out the problem! Following iBug's answer, you'll remove all the permissions but how do you set Full Control permission to yourself? that's where I got stuck at first as I didn't knew how to do that. After Disabling Inheritance, you'll be able to delete all allowed users or groups. Once Done with that, Click on It'll load the name if user exists. Then, Click on This will setup Full Control permission to SYSTEM, Administrators and Your User. After that try to ssh using that key. It should be solved now. I had same issue and I solved that using this method. If there's any user or group with that name then it'll load that. -Screenshots- Permission Entries Select a Principal/ Select User or Groups answered Feb 8, 2019 at 14:20
2 I'm a Window user, using the Windows's bash and followed all the steps to set permission using Windows GUI, and it still doesn't work and it complains:
The I added answered Nov 26, 2019 at 6:10
3 I had the same problem on Windows 10, and it arouse when I created a second user account on my machine. Since that new user was also an administrator and It had access to my user folder, I did these steps to limit the access on my
Now try to log back in to your remote computer using ssh! Hope it helps someone! answered May 15, 2020 at 23:15
3 What does unprotected private key file mean?The reason the "Warning: Unprotected Private Key File" AWS error occurs is because we're trying to SSH into an EC2 instance using a private key that allows read access to other users. A private key must only be readable by your user on the machine in order to allow you to SSH into an EC2 instance.
How do I fix unprotected private key?To fix this,. you'll need to reset the permissions back to default: sudo chmod 600 ~/.ssh/id_rsa sudo chmod 600 ~/.ssh/id_rsa.pub. If you are getting another error: ... . This means that the permissions on that file are also set incorrectly, and can be adjusted with this: sudo chmod 644 ~/.ssh/known_hosts.. How do I change the permissions of a .PEM file in Windows?Fregionz commented on Sep 3, 2021. select .pem file -> right click -> properties.. Security > Advanced > Disable inheritance.. Remove all Users.. Add > Select a principal.. In "Enter the object name to select" type your Windows username > ok.. Give all permissions > ok > apply.. |