2

The IP in the following picture is replaced with xs for security purposes

ssh -i key.pem ec2-user@xxx.xxx.xxx.xxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'key.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 "key.pem": bad permissions
ec2-user@xxx.xxx.xxx.xxx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

So, I run into the issue highlighted in the code above. I'm told that to fix this, the file in question needs to be only available to me, and that I have to be the owner. Simple enough. The problem comes in doing that. I followed the basic instructions to set only myself as having access to the file, that is

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.

But, the problem arises with this security group called "ALL APPLICATION PACKAGES", which I cannot get rid of for the life of me. Every time I get rid of it with 'Remove', it automatically comes back when I hit 'Apply'. I think this one group is preventing me from being able to SSH into the ec2 server.

Image of what this user group looks like from my comp:

IMG:

Any ideas? All the info I've found is just that it's some very recent feature on windows 10, but nothing about a fix.

P.S. I don't care about my name being visible.

3
  • If you create a new file in that directory, does the same thing happen to that new file?
    – Pheric
    May 24, 2020 at 15:49
  • That's very bizarre. I created a text file to see if that was the case, and it wasn't. I then copied the .pem and it also wasn't doing it, so I just changed the permissions for the copy and got rid of the original. What a stupid workaround. May 24, 2020 at 15:54
  • Does this answer your question? Windows SSH: Permissions for 'private-key' are too open
    – Ramhound
    May 24, 2020 at 16:52

2 Answers 2

0

As Pheric suggested, I managed to find a workaround by creating a copy of the file and attempting to edit the permissions on that.

0

Yeah, so all you have to do is right-click the .pem file and select "Give access to" then "remove access". NO NEED TO COPY THE FILE! It's that easy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.