I'm on windows 10 education and I need to configure a remote access.
I managed to install WSL2, Ubuntu 20.04 and I followed this tutorial https://www.illuminiastudios.com/dev-diaries/ssh-on-windows-subsystem-for-linux/
Now I can connect locally with myusername@Ipv4.
But it doesn't work from another desktop: "port22: Connection timed out". I tried from two computers connected to the same network with VPN.
I don't know how to debug this. Thank you in advance for any help.
Apart from having sshd configured incorrectly, I think WSL and WSL2 both only forward ports listening on localhost, making them inaccessible for remote connections (I had a similar discussion here) https://github.com/microsoft/WSL/discussions/4872#discussioncomment-76626
You can configure netsh to setup a portforward from 0.0.0.0 (all interfaces) to localhost for certain ports if needed, but I don't know the syntax on top of head. You can find the documentation for it here:
Just a word of caution though. The WSL2 will have access to your Windows file system, it isn't working like a normal virtualization. If you allow other people into your WSL2 machine, they will be able to read and write to your file system to some extent which might not be what you want, and accessing it over SSH is rarely what you want.