I have a key file located at C:\private-key.pem
and I have a soft link to it on the Ubuntu subsystem: ~/.ssh/private-key.pem -> /mnt/c/private-key.pem
.
When I'm trying to ssh into some remote machine from the Ubuntu subsystem, I get:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/home/artur/.ssh/private-key.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/artur/.ssh/private-key.pem": bad permissions
Permission denied (publickey).
- This began after the 1803 update for Windows: I was trying to use
chmod 400
for the key onC:\
and within~/.ssh
on WSL. I trying to set owner to me and remove all other users' ACLs on Windows for this key file, but every time I getPermission denied
or
Permissions XXXX for '/home/artur/.ssh/private-key.pem' are too open
.
Can anybody help me and explain how keys permissions should be configured on Windows and the Ubuntu subsystem?
options = "metadata"
under the automount section in /etc/wsl.conf then runningchmod 600
on the ssh file (check devblogs.microsoft.com/commandline/…). You also need to log out and log back in and make sure thatC:
now has the automount option inmount -l
More info about the automount options could be found here: devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements