首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Clion和cmd ssh WSL在windows 10上被拒绝

Clion和cmd ssh WSL在windows 10上被拒绝
EN

Stack Overflow用户
提问于 2020-06-02 19:51:48
回答 1查看 2.4K关注 0票数 0

我已经为我的计算机配置了WSL,并且它在WSL终端上工作成功。

代码语言:javascript
运行
复制
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。

代码语言:javascript
运行
复制
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文件的一些信息:

代码语言:javascript
运行
复制
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

非常感谢!

EN

Stack Overflow用户

回答已采纳

发布于 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/

票数 3
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62151365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档