Deprecated: Creation of dynamic property c2c_AddAdminCSS::$admin_options_name is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$config is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$disable_contextual_help is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$disable_update_check is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$hook_prefix is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$form_name is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$menu_name is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$name is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$nonce_field is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$settings_page is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$show_admin is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$textdomain is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$textdomain_subdir is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 106 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$author_prefix is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 109 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$id_base is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 110 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$options_page is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 111 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$plugin_basename is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 112 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$plugin_file is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 113 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$plugin_path is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 114 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$u_id_base is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 115 Deprecated: Creation of dynamic property c2c_AddAdminCSS::$version is deprecated in /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php on line 116 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/add-admin-css/c2c-plugin.php:106) in /var/www/html/wp-includes/rest-api/class-wp-rest-server.php on line 1768 {"id":172,"date":"2022-07-02T20:44:36","date_gmt":"2022-07-02T13:44:36","guid":{"rendered":"https:\/\/erwin.co\/?p=172"},"modified":"2022-07-05T18:32:07","modified_gmt":"2022-07-05T11:32:07","slug":"sharing-windows-openssh-keys-for-linux-dual-boot","status":"publish","type":"post","link":"https:\/\/erwin.co\/sharing-windows-openssh-keys-for-linux-dual-boot\/","title":{"rendered":"Sharing Windows OpenSSH keys for Linux Dual Boot"},"content":{"rendered":"\n
TL\/DR: If you run into problems with opensshd permissions on windows, open a PowerShell Administrator prompt and run:<\/strong><\/p>\n\n\n\n Previously I wrote about Installing OpenSSH on Windows<\/a>. For my workflow, I actually prefer to dual-boot Linux and Windows even though WSL2 has come a long way.<\/p>\n\n\n\n I use Barrier<\/a> (open source successor to synergy) to share my mouse (well trackball) and keyboard across my workstation and laptop, regardless of whether Linux or Windows is running - I securely share the same underlying keys, and have the dhcp server assign a fixed IP to each MAC address.<\/p>\n\n\n\n It's actually quite tricky to get your OpenSSH keys from Linux's Windows iacls are a bit like selinux<\/em> or AppArmor<\/em>. Not a trivial subject, so be prepared if you're going to wade in.<\/p>\n\n\n\n iacls have inheritance, removed with For me, the most confusing thing about icacls is that if you break the permissions in certain ways (for example removing inheritance before you've granted some individual permissions to that file), you can no longer use icacls to fix them! You have to use Because I am not a master of When trying to run The PowerShell team provides a guide for exactly what ACL permissions are required to for your cd C:\\ProgramData\\ssh\n\ntakeown \/R \/F ssh_host*\n\nicacls ssh_host* \/T \/Q \/C \/RESET\n\nicacls ssh_host* \/grant SYSTEM:`(F`)\n\nicacls ssh_host* \/grant Administrators:`(F`)\n\nicacls ssh_host* \/inheritance:r\n\nicacls ssh_host* \/setowner system<\/code><\/pre>\n\n\n\n
\/etc\/ssh\/ssh_host_*key<\/code> to
C:\\ProgramData\\ssh\\ssh_host_*key<\/code> because of ACL details, even though I only edited the files with nvim<\/em> - I thought that should preserve the icacls status, but it doesn't.<\/p>\n\n\n\n
\/inheritance:r<\/code><\/p>\n\n\n\n
takeown<\/code> to re-assert ownership, and then you can start using icacls again.<\/p>\n\n\n\n
PS C:\\ProgramData\\ssh> net stop sshd
The OpenSSH SSH Server service was stopped successfully.<\/code><\/p>\n\n\n\nPS C:\\ProgramData\\ssh> net start sshd
The OpenSSH SSH Server service is starting.
The OpenSSH SSH Server service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.<\/code><\/p>\n\n\n\nicacls<\/code>, I completely hosed my entire
C:\\ProgramData<\/code> permissions while trying to
fix ssh<\/code>...<\/p>\n\n\n\n
sshd<\/code> directly from the command line rather than via the windows service<\/em> infrastructure, I actually got a bit more detail.<\/p>\n\n\n\n
PS C:\\WINDOWS\\system32> sshd -dd\ndebug2: load_server_config: filename __PROGRAMDATA__\\\\ssh\/sshd_config\ndebug2: load_server_config: done config len = 158\ndebug2: parse_server_config: config __PROGRAMDATA__\\\\ssh\/sshd_config len 158\ndebug1: sshd version OpenSSH_for_Windows_8.1, LibreSSL 3.0.2\ndebug1: get_passwd: LookupAccountName() failed: 1332.\ndebug1: Unable to load host key: __PROGRAMDATA__\\\\ssh\/ssh_host_rsa_key\ndebug1: Unable to load host key: __PROGRAMDATA__\\\\ssh\/ssh_host_ecdsa_key\ndebug1: Unable to load host key: __PROGRAMDATA__\\\\ssh\/ssh_host_ed25519_key\nsshd: no hostkeys available -- exiting.<\/code><\/pre>\n\n\n\n
ssh_host_*<\/code> files.<\/p>\n\n\n\n