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.