我已经为我的计算机配置了WSL,并且它在WSL终端上工作成功。
zoom@Zoom:/etc/ssh$ ssh zoom@localhost -p 2222
zoom@localhost's password:
Welcome to Ubuntu 20.04 LTS (GNU/Linux 4.19.104-microsoft-standard x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Tue Jun 2 19:42:24 CST 2020
System load: 0.0 Processes: 16
Usage of /: 0.9% of 250.98GB Users logged in: 0
Memory usage: 1% IPv4 address for eth0: myIpAddress
Swap usage: 0%
0 updates can be installed immediately.
0 of these updates are security updates.
Last login: Tue Jun 2 19:33:21 2020 from 127.0.0.1但是,我不能用cmd或Clion ssh WSL。
CMD:
C:\Users\Zoom>ssh zoom@localhost -p 2222
ssh: connect to host localhost port 2222: Connection refused
Clion ssh
I get this error
Can't connect to remote host: Connection refused: connect我已经尽了最大的努力去寻找解决方案。但是没有有效的解决方案。
以下是有关我的sshd_config文件的一些信息:
ListenAddress 0.0.0.0
Port 2222
UsePrivilegeSeparation no
PasswordAuthentication yes
AllowUsers zoom我真的想知道怎么修好它。
我的Windos版本是2004年(os build 19635.1)。
WSL版本为2。
WSL系统为ubuntu-20.04
非常感谢!
发布于 2020-06-03 00:27:35
好了,我明白问题所在了。据说WSL2使用虚拟机。因此,WSL中的IP与Windows中的IP是不同的。在WSL版本1中不会有这个问题。不幸的是,这将在您每次重新启动时更改WSL的IP地址。也有一些解决方案,但是我不明白,所以我会把来自某个博客的链接放在中文:https://www.oyohyee.com/post/note_wsl2_net (我不知道这个博客能不能解决这个问题,但看起来可以)我找到了官方的解决方案:https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-insiders-preview-build-18945/
https://stackoverflow.com/questions/62151365
复制相似问题