写入公钥后在 windows 宿主机上就可以使用ssh <username>@127.0.0.1 -p xxxxx测试能否连接到 wsl2。
首先搜索【启用或关闭Winsows 功能】 然后勾选【适用于linux的Windows子系统】和【虚拟平台】 安装所选的 Linux 分发版 打开 Microsoft Store,搜索WSL2并选择你偏好的 Linux 分发版 WSL与WSL2有所不同,我记得没升级到WSL2时ssh按常规方式就能连接,WSL2貌似不行了 参考ssh连接WSL2 ubuntu 18.04 一、重新安装opens...
ssh <WSL2_id>@localhost# If not working try to re-install SSH service on WSL2# Run this on windows powershell# wsl --shutdown# wsl# Run this on WSL2# sudo service ssh restart Step 4: 测试WSL2与外部网络的连接 # Run this on WSL2ping baidu.com 通过SSH Jump实现远程SSH进入WSL2 Step...
wsl-uroot ip addr add172.29.240.181/24broadcast172.29.240.0dev eth0 label eth0:1echosetwsl ip success:172.29.240.181) ipconfig | findstr"172.29.240.100"> nulif!errorlevel! equ0(echowindows ip hasset)else( netsh interface ip add address"vEthernet (WSL)"172.29.240.100255.255.255.0echosetwindows ...
WSL2 设置ssh登录,以及其他的一点配置 以前在windows 10用过wsl1下的ubuntu,这次在windows 11下,设置ssh server有点不一样,当然是更加简单了,但也还是记录下,就算方便自己后面查询了。Ubuntu-2022.04装好后,openssh-server是装好的,但是呢key没有生成,因此在你开启ssh-server的时候, sudo service ssh ...
要在WSL2中安装SSH服务,请按照以下步骤操作: 确认Windows系统版本支持WSL2: 确保你的Windows系统版本为Windows 10版本2004及以上(内部版本19041及以上)或Windows 11。 启用Windows的WSL功能: 以管理员身份打开PowerShell,运行以下命令来启用“适用于Linux的Windows子系统”和“虚拟机平台”功能: powershell dism.exe...
【搞linux的旺仔】【ubuntu系统环境搭建】:2.windows通过ssh连接wsl虚拟机中的ubuntu系统 07:17 【搞linux的旺仔】【ubuntu系统环境搭建】3.wsl ubuntu访问U盘设备 06:31 【搞linux的旺仔】【ubuntu系统环境搭建】:认识ubuntu命令(1) 17:43 【搞linux的旺仔】【ubuntu系统环境搭建】:认识ubuntu命令(2) 16:54...
Since build 21354.1, I cannot ssh into WSL2 from Windows with ssh myself@localhost -p2222, which I have used w/o problem for quite some time. Now it always gives error 10061 PS C:\Users\astro> ssh -vvv myself@localhost -p2222 OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 debug1: Re...
connectport对内映射的端⼝,即WSL的端⼝ listenaddress Windows对外监听的地址,也可以是0.0.0.0 设置Windows的防⽕墙,允许监听端⼝的对内连接:# 在Windows的shell内执⾏(可能需要管理员权限)netsh advfirewall firewall add rule name=”Open Port 8080 for WSL2” dir=in action=allow protocol=...
1 的用户名;WSL 2 则输入 Windows 系统的用户名Port2222# 访问 WSL 1 的端口 2222 端口;WSL 2 ...