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,3757 gold badges35 silver badges65 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 6935 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.8k18 gold badges159 silver badges204 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,6212 gold badges34 silver badges42 bronze badges answered Feb 16, 2019 at 21:58
4 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 1171 silver badge4 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.4k37 gold badges128 silver badges196 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 How do I change SSH key permissions?Changing File Permissions
We'll first log into our account via SSH and use the pwd command to see which folder we're in. We'll then run the ls command to see the current files and their permissions, run the chmod command to edit permissions, and then finally use ls again to see that the permissions have been changed.
What should permissions be for SSH keys?ssh directory permissions should be 700 (drwx------). The public key (. pub file) should be 644 (-rw-r--r--). The private key (id_rsa) on the client host, and the authorized_keys file on the server, should be 600 (-rw-------).
How do I change private key permissions in Windows?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.
How do I change key permissions?To open the Registry Editor, click Start > Run > Type regedit.exe > Press Enter. In the left pane, right-click on the key that needs permission then click Permissions. Select the group or username where the permission needs to be applied. Select the Allow check box for the access levels of the group or username.
|