Created
July 25, 2019 14:12
-
-
Save designium/6e661fdc230b081ff489a9bb0f5bf705 to your computer and use it in GitHub Desktop.
Revisions
-
harleyday revised this gist
May 7, 2018 . 1 changed file with 4 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,16 +6,10 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 1. Uninstall and reinstall the ssh server using the following commands: 1. `sudo apt remove openssh-server` 2. `sudo apt install openssh-server` 2. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: 1. `sudo service ssh start` 3. Follow the next steps which will create scripts that start the ssh server automatically: 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` - Add the following code: `C:\Windows\System32\bash.exe -c "sudo /etc/init.d/ssh start"` @@ -34,7 +28,7 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running - Open start menu, type `run`. Then type `shell:startup`. Copy the vbs file over to the Startup folder 3. Finally, you will need to configure the ssh server to start without requiring password. Run the command `sudo visudo` and add this line to the end of the file: - `%sudo ALL=NOPASSWD: /etc/init.d/ssh` 4. If configured properly, the ssh server should now automatically start in the background when Windows starts. --- -
harleyday revised this gist
May 7, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ ## How to automatically start ssh server on boot on Windows Subsystem for Linux ------------------------------------------------------------------------------- *This works with Ubuntu 18.04LTS. I make no promises about other distributions, but direct anyone else to an [older Gist](https://gist.github.com/dentechy/de2be62b55cfd234681921d5a8b6be11#file-wsl-ssh-server-md) which apparently works for 16.04LTS.* Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide). Below are instructions on how to set up the ssh server to run automatically at boot. -
harleyday revised this gist
May 7, 2018 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 5. Follow the next steps which will create scripts that start the ssh server automatically: 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` - Add the following code: `C:\Windows\System32\bash.exe -c "sudo /etc/init.d/ssh start"` - Save the file and move it to a more accessible location, e.g. `mv sshd.bat /mnt/c/Users/YourUserName/Documents`. Make sure to match your username! Take note of this location for the next step as in Windows language this corresponds to `C:\Users\YourUserName\Documents` 2. Create a sshd.vbs file and edit it with the following commands: - `vi sshd.vbs` @@ -31,5 +31,9 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running - Save the file and move it to a more accessible location, e.g. `mv sshd.vbs /mnt/c/Users/YourUserName/Documents`. - Open start menu, type `run`. Then type `shell:startup`. Copy the vbs file over to the Startup folder 3. Finally, you will need to configure the ssh server to start without requiring password. Run the command `sudo visudo` and add this line to the end of the file: - `%sudo ALL=NOPASSWD: /etc/init.d/ssh` 6. If configured properly, the ssh server should now automatically start in the background when Windows starts. --- **My thanks go to [dentechy](https://gist.github.com/dentechy) for his [original GitHubGist](https://gist.github.com/dentechy/de2be62b55cfd234681921d5a8b6be11#file-wsl-ssh-server-md) on this subject. I found that the instructions he provides do not work if you've upgraded your Windows Subsystem Linux Ubuntu to 18.04LTS since the UsePrivilegeSeparation option has been depreciated on the ssh server for 18.04LTS. The above is my workaround.** -
harleyday revised this gist
May 7, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` - Add the following code: `C:\Windows\System32\bash.exe -c "sudo /usr/sbin/sshd -D"` - Save the file and move it to a more accessible location, e.g. `mv sshd.bat /mnt/c/Users/YourUserName/Documents`. Make sure to match your username! Take note of this location for the next step as in Windows language this corresponds to `C:\Users\YourUserName\Documents` 2. Create a sshd.vbs file and edit it with the following commands: - `vi sshd.vbs` - Add the following code, making sure to put in your actual user name: -
dentechy revised this gist
Oct 23, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 2. Change `UsePrivilegeSeparation` to no 3. Change `PasswordAuthentication` to yes. This can be changed back to no if ssh keys are setup. 3. Restart the ssh server: - `sudo service ssh --full-restart` 4. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: 1. `sudo service ssh start` 5. Follow the next steps which will create scripts that start the ssh server automatically: -
dentechy revised this gist
Oct 23, 2017 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,15 +5,15 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 1. Uninstall and reinstall the ssh server using the following commands: 1. `sudo apt remove openssh-server` 2. `sudo apt install openssh-server` 2. Edit the `/etc/ssh/sshd_config` file by running the command `sudo vi /etc/ssh/sshd_config` and do the following 1. Change `Port` to 2222 (or any other port above 1000) 2. Change `UsePrivilegeSeparation` to no 3. Change `PasswordAuthentication` to yes. This can be changed back to no if ssh keys are setup. 3. Restart the ssh server: - `sudo service ssh --full-restart` 4. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: 1. `sudo service ssh start` 5. Follow the next steps which will create scripts that start the ssh server automatically: 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` - Add the following code: `C:\Windows\System32\bash.exe -c "sudo /usr/sbin/sshd -D"` @@ -32,4 +32,4 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running - Open start menu, type `run`. Then type `shell:startup`. Copy the vbs file over to the Startup folder 3. Finally, you will need to configure the ssh server to start without requiring password. Run the command `sudo visudo` and add this line to the end of the file: - `%sudo ALL=NOPASSWD: /usr/sbin/sshd` 6. If configured properly, the ssh server should now automatically start in the background when Windows starts. -
dentechy revised this gist
Oct 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,4 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running - Open start menu, type `run`. Then type `shell:startup`. Copy the vbs file over to the Startup folder 3. Finally, you will need to configure the ssh server to start without requiring password. Run the command `sudo visudo` and add this line to the end of the file: - `%sudo ALL=NOPASSWD: /usr/sbin/sshd` 4. If configured properly, the ssh server should now automatically start in the background when Windows starts. -
dentechy revised this gist
Oct 22, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,11 +8,11 @@ Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running 3. Edit the `/etc/ssh/sshd_config` file by running the command `sudo vi /etc/ssh/sshd_config` and do the following - Change `Port` to 2222 (or any other port above 1000) - Change `UsePrivilegeSeparation` to no - Change `PasswordAuthentication` to yes. This can be changed back to no if ssh keys are setup. 4. Restart the ssh server: - `sudo service ssh --full-restart` 2. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: 1. `sudo service ssh start` 3. Follow the next steps which will create scripts that start the ssh server automatically: 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` -
dentechy created this gist
Oct 22, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ## How to automatically start ssh server on boot on Windows Subsystem for Linux Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide). Below are instructions on how to set up the ssh server to run automatically at boot. 1. Uninstall and reinstall the ssh server using the following commands: 1. `sudo apt remove openssh-server` 2. `sudo apt install openssh-server` 3. Edit the `/etc/ssh/sshd_config` file by running the command `sudo vi /etc/ssh/sshd_config` and do the following - Change `Port` to 2222 (or any other port above 1000) - Change `UsePrivilegeSeparation` to no - Change `PasswordAuthentication` to yes. This will be initially necessary for logging in to the ssh server and setting up keys in the next section. 4. Restart the ssh server: - `sudo service ssh --full-restart` 2. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: 1. `sudo service ssh start` [starts ssh server] 3. Follow the next steps which will create scripts that start the ssh server automatically: 1. Create a sshd.bat file and edit it with the following commands: - `vi sshd.bat` - Add the following code: `C:\Windows\System32\bash.exe -c "sudo /usr/sbin/sshd -D"` - Save the file and move it to a more accessible location, e.g. `mv ssh.bat /mnt/c/Users/YourUserName/Documents`. Make sure to match your username! Take note of this location for the next step as in Windows language this corresponds to `C:\Users\YourUserName\Documents` 2. Create a sshd.vbs file and edit it with the following commands: - `vi sshd.vbs` - Add the following code, making sure to put in your actual user name: ``` Set WinScriptHost = CreateObject("WScript.Shell") WinScriptHost.Run Chr(34) & "C:\Users\YourUserName\Documents\sshd.bat" & Chr(34), 0 Set WinScriptHost = Nothing ``` - Save the file and move it to a more accessible location, e.g. `mv sshd.vbs /mnt/c/Users/YourUserName/Documents`. - Open start menu, type `run`. Then type `shell:startup`. Copy the vbs file over to the Startup folder 3. Finally, you will need to configure the ssh server to start without requiring password. Run the command `sudo visudo` and add this line to the end of the file: - `%sudo ALL=NOPASSWD: /usr/sbin/sshd` 4. If configured properly, the ssh server should now automatically start in the background when Windows starts.