I’ve tried quite a few different setups for administering my various linux boxen from Windows, and this is currently my favourite: Mintty for WSL (aka WSLtty).
Here’s how to set it up.
Install Windows Subsystem for Linux (WSL):
- Open Powershell as an administrator
- Enter this command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- When it’s done, restart your computer.
Install Linux (on WSL)
I recommend Debian – it’s well supported by the community, and a pretty lightweight install compared to some of the other choices.
For the local windows store
- Open the Windows Store
- Search for “Debian”
- Click on Get
- Click on Install
Once it’s installed:
- Find and click on the Debian app in your start menu
- Wait for a moment, then set up a username for this local installation of linux. It’ll be slightly more convenient if you use the same username you have on your remote linux machines.
- Exit the terminal: type:
exit
and press enter.
This info came from https://docs.microsoft.com/en-us/windows/wsl/install-win10
Install WSLtty
- Go to https://github.com/mintty/wsltty/releases/latest
- Choose the right release for your system – unless you have a fairly old computer it’ll be the one ending in “x86_64.exe”
- Download and install.
- This app isn’t digitally signed in a way approved by Microsoft, so a warning will pop up (“Windows protected your PC”). Click More info then Run anyway.
Run and connect!
Mintty should have installed a shortcut called “WSL Terminal” with the linux penguin icon, click on it and you’ll get a black terminal windows with prompt in the top left: [your unix username]@[computer name]:~$
Let’s get your local linux system up to date:
- Type
sudo apt update
then press enter. - Type in your local linux password (that you created earlier)
sudo apt upgrade
, then pressy
and enter when asked if you want to continue- It may take a little while, depending on the speed of your pc and internet connection.
- Finally lets install ssh:
sudo apt install ssh
Now we can connect to a remote linux computer:
If the username on the remote computer is the same as the one you created earlier, the command is:ssh remotelinuxcomputer.example.com
or ssh 192.168.2.1
, when you put in the computer’s name or ip address.
If the username is different, no problem, do this:ssh joebloggs@remotelinuxcomputer.example.com
orssh joebloggs@192.168.2.1
In either case, you will probably get a warning about “the authenticity of the host xxxxx can’t be established”. Don’t worry, just type yes, then enter you password for the remote computer, and you’re in!
One final tip
If ssh into remote computers is all your do with this, then log out, the login command will be remembered by the shell, even if you reboot.
Next time you open the WSL terminal, press the “Up” as many times as you need to scroll through the command history and find the one you wanted.