Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 87

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/themes/Divi/includes/builder/functions.php on line 4940
Bash on Ubuntu on Windows - SSH using private key and Windows permissions - Kieron Howard
Select Page

I’m a big fan of Bash On Ubuntu On Windows

https://docs.microsoft.com/en-us/windows/wsl/about

and for the most part it “just works”, however I did run into an issue trying to SSH into a server using
a key rather than password. OpenSSH requires that permissions on the key file are only readable by the current user.
Trying to connect results in the following error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0555 for 'mykey.Private.openssh.ppk' 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: mykey.Private.openssh.ppk
Permission denied (publickey).

Trying to do a

chmod 600 mykey.Private.openssh.ppk

Doesn’t help, as *nix permissions don’t really map to Windows file permissions. I read some suggestions that you can adjust the permissions in Windows using the “advanced security settings” tabs in properites
but this didn’t work for me.

What did work was copying the key to the Ubuntu subsystem users home, and then chmodding that, then using that to ssh from eg:

Cp mykey.Private.openssh.ppk ~/.ssh/mykey.Private.openssh.ppk
chmod 600 ~/.ssh/mykey.Private.openssh.ppk
ssh me@123.456.789.123 -i ~/.ssh/mykey.Private.openssh.ppk
%d bloggers like this: