I am writing this up in order to have it documented how I got an SSH tunnel into my WSL2 Ubuntu environment, as I kept having issues along the way. So I wanted to document things more clearly for myself in the future, and I hope this helps someone else along the way
I started with this guide
First issue I ran into is that wsl hostname -I
command in the sshd.bat
didn't work due to -I
not being an option in the default WSL2 distro (the one that WSL launches into if you don't install any other distros). I ran wsl hostname --help
and learned there was a -i
, so I changed it to that, since that does spit out an IP. It just turns out that's not the IP you want. This was my point of failure.
I kept running into a kex_exchange_identification: Connection closed by remote host
error. After some hours of debugging, I realized the ip address s