New
#1
sshing to localhost WSL2 is unstable at best. misery and despair
I have a wsl issue that's been driving me mad for weeks: when booting the pc, there's a big chance that ssh connections to wsl won't be operational until one or more reboots. I get a Connection refused error.
I went through lots and lots of similar github issues, but none of them really went anywhere.
I think my localhost forwarding is fine, because I can access a wsl http server (python3 -m http.server 8080) from the browser on Windows (http://localhost:8080/). VSCode's remote development works fine too, it uses a custom server.
I have Bitdefender's firewall enabled, and while currently there's a bug that breaks ICMP ping to localhost when the firewall is enabled, everything works the same with it either being on or off. Network level interferences are usually logged, no entries are created, so maybe it can be excluded.
My ssh has been configured by this script, I see no obscure things there. I use ssh through CLion to do cross platform C development and it's amazing, when it works.
sshd_config:
Code:# configured by CLion ListenAddress 127.0.0.1 #i've tried 0.0.0.0 too, just to try Port 2222 UsePrivilegeSeparation no PasswordAuthentication yes
I'm an IT student, but I'm not an experienced Linux user. My vm is using Ubuntu 20.04, regularly updated.
Some people have mentioned that localhost is resolved to ::1 on windows, and Ubuntu is expecting a IPv4 address instead. I'm not too sure about that.. This setup occasionally does work.
I'm pretty much lost and I don't know what to think of anymore.
Windows 10 Pro 20H2 19042.630