WSL will start in your C:\Users{user} directory.

Put the file in /home/{user}, then change the permissions.

Answer from Alymsin on Stack Exchange
🌐
Chmod Command
chmodcommand.com › home › chmod 400
Chmod 400
View (u)ser, (g)roup and (o)thers permissions for chmod 400 (chmod a+rwx,u-wx,g-rwx,o-rwx) or use free online chmod calculator to modify permissions easily.
Discussions

amazon web services - Set pem file permissions for AWS without chmod on Windows - Stack Overflow
Trying to SSH into our AWS instance, I get "bad permissions" every time. The AWS documentation gives a simple solution, which is to change the pem file permissions using chmod. But my local machine... More on stackoverflow.com
🌐 stackoverflow.com
shell - chmod 400 command returning "No such file or directory" error. Trying to launch an instance through AWS - Unix & Linux Stack Exchange
CODE: root@crane-linux:/home/crane/Downloads# sudo chmod 400 ~/home/crane/Downloads/mykey.pem chmod: cannot access '/root/home/crane/Downloads/mykey.pem': No such file or directory root@crane-lin... More on unix.stackexchange.com
🌐 unix.stackexchange.com
March 12, 2017
linux - Not able access a file when using chmod 400 - Stack Overflow
I need to give a user in AWS permission to a key pair using chmod 400 command, but when I do that in the terminal I get an error as attached devmoki@devmoki-HP-250-G2-Notebook-PC:~$ sudo chmod 400 More on stackoverflow.com
🌐 stackoverflow.com
I guess I broke Linux? I ran "chmod 400 chmod" and now if I run chmod I get permission denied. Help?

http://www.linuxnetadmin.com/2013/05/permissions-broken-on-binchmod.html

edit: easy mode fix!

More on reddit.com
🌐 r/linux
38
69
October 24, 2013
🌐
AccuWeb Hosting
manage.accuwebhosting.com › knowledgebase › 4759 › Understanding-chmod-400-with-hands-on-examples.html
Understanding chmod 400 with hands on examples - AccuWebHosting
Using the chmod command with the argument "400" grants only the owner or user of the file read permission while restricting everyone else entirely. This method is frequently used to secure an SSH private key.
🌐
Quora
quora.com › What-does-chmod-400-mean
What does chmod 400 mean? - Quora
Answer (1 of 3): chmod => change modification of file permission In linux their are 3 type of owner and 3 type of permission 3 type OWNERSHIP 1.user 2.group 3.other 3 type PERMISSION 1.Read 2.Write 3.Excute so chmod means change the ownership and permission sudo chmod 400 here 3 digit...
🌐
GitHub
gist.github.com › jaskiratr › cfacb332bfdff2f63f535db7efb6df93
Set permission of file equivalent to chmod 400 on Windows. · GitHub
for windows users use: icacls.exe your_key_name.pem /reset icacls.exe your_key_name.pem /grant:r "$($env:username):(r)" icacls.exe your_key_name.pem /inheritance:r thats it! your keys.pem have same restrisctions as you use chmod 400
Find elsewhere
🌐
Medium
medium.com › @kofiseysey › changing-file-permissions-with-chmod-on-the-linux-terminal-d3ca93f47d69
CHANGING FILE PERMISSIONS WITH “chmod” ON THE LINUX TERMINAL | by Kofi Sey | Medium
July 25, 2023 - Hence, in “chmod 400 keypair.pem” you are using the “chmod” command to grant permission “4” to the user, permission “0” to the group category of users, and same permission “0” to other users.
🌐
DropVPS
dropvps.com › home › blog › what is chmod 400 in linux terminal?
What is chmod 400 in Linux terminal?
September 20, 2025 - chmod 400 is a command in Linux that sets read-only permissions for the file owner and no permissions for group or others.
🌐
DEV Community
dev.to › surajvatsya › 400-linux-permission-43k4
400 linux permission - DEV Community
July 17, 2025 - The permission 400 in Linux refers to file permissions that you can set using the chmod command....
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-set-permissions-linux
How to Set Permissions in Linux: A Guide to chmod and chown | DigitalOcean
May 7, 2025 - chmod 400 sets the permissions of a file or directory to allow only the owner to read, and denies all permissions to the group and others.
🌐
Medium
beverly-wang0005.medium.com › windows-how-to-do-chmod-400-7f6bf0145a4d
Windows: How to Do chmod 400?. I recently switched from macOS to… | by Beverly Wang | Medium
January 4, 2022 - I recently switched from macOS to Windows 10 for some projects when using AWS, and of course, met some small but uncomfortable issues. The first one is chmod 400 on the .pem file. It is quite straightforward to do so in macOS (just key in chmod 400 “yourpemfile.pem” in the terminal is enough).
🌐
Stack Overflow
stackoverflow.com › questions › 61848377 › not-able-access-a-file-when-using-chmod-400
linux - Not able access a file when using chmod 400 - Stack Overflow
devmoki@devmoki-HP-250-G2-Notebook-PC:~$ sudo !! sudo chmod 400 jenkins us-west-2 jenkinskeypair.pem [sudo] password for devmoki: chmod: cannot access 'jenkins': No such file or directory chmod: cannot access 'us-west-2': No such file or directory chmod: cannot access 'jenkinskeypair.pem': No such file or directory
🌐
iO Flood
ioflood.com › blog › chmod-400
chmod 400 Explained | Set Read-Only Permission in Linux
May 23, 2024 - The ‘400’ part specifies the permissions in a numerical format, where ‘4’ stands for ‘read’, ‘2’ stands for ‘write’, and ‘1’ stands for ‘execute’. The three digits represent the owner, group, and others, respectively.
🌐
Reddit
reddit.com › r/linuxquestions › issue with ssh private key file being too open, chmod 600 or 400 doesn't fix.
r/linuxquestions on Reddit: Issue with ssh private key file being too open, chmod 600 or 400 doesn't fix.
October 20, 2023 -

Permissions 0777 for '/mnt/c/Users/onwin/source/repos/.ssh/id_ed25519' are too open.

It is required that your private key files are NOT accessible by others.

I tried sudo chmod 600 ~/.ssh/id_ed25519

but same error, and changing it to 400 just gives me the same error, but with Permissions 0555

instead.

This happens when i'm trying to ssh-add. What am I doing wrong?

Doing ls -l gives me -r-xr-xr-x 1 lilbluey lilbluey 464 Oct 20 11:50 /mnt/c/Users/onwin/source/repos/.ssh/id_ed25519

~ leads to ..../source/repos as I changed the /etc/passwd file for this user.

Is it an issue with chmod 400 being too lax? I thought it meant the highest level of security.

or maybe my ~ shouldn't be in /source/repos?

For context, generated ssh key for github, but this error happened when doing ssh-add