Score:0

Access: (0000/----------) on a file in linux. Do I have a dead file?

pk flag

Preface: I'm not a linux person. I'm a webdev trying to SSH into a Ec2 instance via WSL. I found the .pem file from the previous developer's (dude left the company) machine and moved a copy to my machine. Every time I try to ssh via WSL into the ec2 instance, I get a permission denied.

In Windows, I removed the SYSTEM and the local machine permissions from the file, leaving the linux ownership to me(I think), disabled the inheritance feature and left full control, see picture:

pem file permissions via windows

This was due to AWS saying that the pem file was too open, the file using Permissions 0555. I've entered into my wsl as root. I've looked at the ec2key1.pem file's permissions and saw this:

---------- 1 "myusername" "myusername"    1696 Nov 22  2019  ec2key1.pem

I suspect that I can't ssh with the .pem file because the SSH client is unable to read the ec2key1.pem because the file doesn't have the permissions to do so?

So I've tried as root to chown, chmod, chattr commands. They all return changing permissions to file, ec2key1.pem, permission denied, with chattr, unable to read flags.

  • Is there anything that I can do to change the permissions of the pem file?
  • Are windows file permissions reflected in linux file permissions?
  • The only other thing that I can think of is to create a new instance of the ec2 instance with a new SSH key?
  • Or should I try to change the ownership of the file on the previous developer's computer to me then move a copy of the file to my computer? I saw something about Access Control Lists (ACL) on stack overflow, can I use those on the previous developer's machine linux?

Drawing blanks here.

Score:0
pk flag

It was permissions! It was more of a Windows issue, than a WSL issue.

Instead of trying to change permissions using the root wsl:

  1. I renabled the inheritance feature (Right clicking the file in Windows Explorer >> Properties >> Security Tab >> Advanced) on the .pem file
  2. Added back my Windows local user and gave it full control.

After made the changeds, I exited out my wsl and into my regular C:/ in cmd, I was able to ssh into my Ec2 instance using the SSH client instructions in AWS.

  • Are windows file permissions reflected in linux file permissions?

Yes they are. After closing the connection with my EC2 instance, I went back into my WSL and checked the pem file's permissions. The permissions changed to:

-r-xr-xr-x 1 "myusername" "myusername"    1696 Nov 22  2019  ec2key1.pem
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.