I'm trying to format a .pem file for access to an EC2 instance through SSH, but no matter what I try among suggestions I've seen, nothing seems to work. For context, I have the .pem file stored on my Windows C:// drive.
From just downloading it, I get the following permissions as seen in my WSL shell (and output of ssh command, fails, obviously):
The following are my attempts to modify this file
- Used Ubuntu's WSL to chmod the file into 400 (what I assume is
-r--------
): (forgot to unhide my username, lol)
1.a. I have modified my wsl.conf with the following to make sure to allow permissions changes to propagate from my WSL shell (Unable to change file permissions on Ubuntu Bash for Windows 10):
- Used Powershell to try to place restrictions on the file (https://stackoverflow.com/questions/39404087/pem-file-permissions-on-bash-on-ubuntu-on-windows):
Now, permissions are `-r--r--r--', which still isn't good enough.
- Made sure the file is only readable by user in Windows settings (Windows SSH: Permissions for 'private-key' are too open):
What else can I do here? This is literally all the answers I've found online and they don't work. Any help is appreciated. Thanks y'all!
EDIT: After some reading, it seems that Powershell has some extra ways to reset permissions but I can't seem to find any definitive source.