Prep the WSL2 Linux Instance
In Windows Terminal, in the drop-down list next to the tab, a Linux penguin icon named Debian now shows up. This is the shell to your Linux instance running in WSL 2.
Install the following software
apt-get install openssh-server g++ gdb make ninja-build rsync zip
and ensure SSH service is running
service ssh start
which should tell you
[ ok ] Starting OpenBSD Secure Shell server: sshd.
SSH into the Linux Instance from Cygwin
When we installed some software in the previous section we had installed the OpenSSH Server and started it. Now configure it by editing /etc/ssh/sshdconfig_, where you change the existing strings to this
Port 2222 PasswordAuthentication yes
and start/restart the SSH server
sudo service ssh restart
[ ok ] Restarting OpenBSD Secure Shell server: sshd.
We need the Linux instance's IP address, so we find that out by
ip addr list
that outputs the eth0 section, a relevant snippet from which, on my system, reads
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:15:5d:e8:cd:90 brd ff:ff:ff:ff:ff:ff inet 192.168.129.170/20 brd 192.168.143.255 scope global eth0
from where I pick the IP address: 192.168.129.170
In a Cygwin terminal connect to the WSL-Linux using
ssh firstname.lastname@example.org -p 2222
which prompts for a password and let's you in. You must have been prompted for a new username when you had installed the Linux distro from Microsoft Store at the time of setting up WSL 2.
I haven't yet been able to make public key authentication work.