sftp 从 Windows-10-v-1803 进入 WSL Ubuntu-18.04 ssh-server...无法连接

sftp 从 Windows-10-v-1803 进入 WSL Ubuntu-18.04 ssh-server...无法连接

不过,以下建议很有趣:
如何通过 SSH 进入“Windows 10 上的 Ubuntu 上的 Bash”?
随着 WSL 的新实现,它们在 Windows-10-v-1803 中可能已经过时。

我安装了 WSL 和 Ubuntu 18.04:https://docs.microsoft.com/en-us/windows/wsl/install-win10

WSL 在 Windows 10 v1803 中发生了重大变化

在 wsl ubuntu 上安装了 openssh-server: https://gist.github.com/dentechy/de2be62b55cfd234681921d5a8b6be11

编辑 sshd_config:sudo nano sshd_config
添加:端口 2222

重启 ssh 服务器: sudo service ssh --full-restart
显示服务器正在运行: ps -A | grep sshd
结果: 202 ? 00:00:00 sshd

在 Windows 10 上以管理员身份打开 cmd,然后运行:sftp -v -P 2222 [user]@localhost
Windows 10 现在有一个内置的 ssh 客户端

结果:
OpenSSH_7.6p1 Ubuntu-4,OpenSSL 1.0.2n 2017 年 12 月 7 日
debug1:读取配置数据 /etc/ssh/ssh_config
debug1:/etc/ssh/ssh_config 第 19 行:应用 * 的选项
debug1:连接到 localhost [127.0.0.1] 端口 2222。
debug1:建立连接。
debug1:key_load_public:没有这样的目录文件
。. debug1:远程协议版本 2.0,远程软件版本 OpenSSH_7.6p1 Ubuntu-4 debug1:匹配:OpenSSH_7.6p1 Ubuntu-4 pat
OpenSSH * conpat 0x04000000 debug1:以 [用户] 身份向 localhost:2222 进行身份验证 debug1:SSH2_MSG_KEXINIT 已发送 连接,由 127.0.0.1 端口 2222 关闭




注意:SSH2_MSG_KEXINIT 已发送,但未收到响应,是否未对用户进行身份验证?

尝试在 WSL bash 中运行相同的命令,结果也是“连接已关闭”。此工作流程确实可以在纯 Ubuntu 18.04 机器上连接。

相关内容