I am attempting to login to my box using my .pem file however I get the error
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0555 for './arete-server.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: ./arete-server.pem
Permission denied (publickey).
chmod 400 doesn't work on Bash on Ubuntu on Windows and the best permissions I can give it is -r-xr-xr-x
Any idea how to get permissions to a point where I can use this pem file?
Type “sudo chmod a+rwx /path/to/file” into the terminal, replacing “/path/to/file” with the file you want to give permissions to everyone for, and press “Enter.” You can also use the command “sudo chmod -R a+rwx /path/to/folder” to give permissions to the selected folder and its files.
You can configure your file permissions inside of your Windows drives using the mount options in wsl. conf. The mount options allow you to set umask , dmask and fmask permissions masks. The umask is applied to all files, the dmask is applied just to directories and the fmask is applied just to files.
On WSL, chmod donesn't work on NTFS partitions used by Windows. You need to move your .pem file to a partition in Linux container (for example the home folder), then chmod 400 will work.
sudo ssh -i mykey.pem ec2-user@ip
works for me
use PowerShell:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With