WindowsWSL无法使用xshell连接问题 启用开发者模式 RestartyourmachinetocompletetheWSLinstallandupdatetoWSL2。wslsetdefaultversion2 首次创建WSL时更换源为阿里云sudocpetcaptsources。listetcaptsources。list。bak备份下原有的源sudovimetcaptsources。list:sarchive。ubuntu。commirrors。aliyun。comg全局替换sudoaptgetupdatesudoaptgetyupgrade更新包并且升级包配置xshellssh连接wslsudoaptgetremoveopensshserver卸载自带的sshsudoaptgetinstallopensshserver再次安装sudovimetcsshsshdconfig添加如下:Port2222默认的是22,但是windows有自己的ssh服务用的也是22端口,修改一下UsePrivilegeSeparationyesPasswordAuthenticationyesChallengeResponseAuthenticationyesPasswordAuthenticationyes保存退出sudoservicesshfullrestart重启ssh服务 不使用ssh秘钥和公钥方式连接忒麻烦!以上连接方式足以连接服务器进行开发