1、先删ssh,再安装ssh
sudo apt-get remove --purge openssh-server ## 先删ssh
sudo apt-get install openssh-server ## 在安装ssh
sudo rm /etc/ssh/ssh_config ## 删配置文件,让ssh服务自己想办法链接
sudo service ssh --full-restart
2、修改配置文件
sudo vim /etc/ssh/sshd_config
Port 6666
ListenAddress 0.0.0.0
PasswordAuthentication yes
3、重启ssh(每次重启wsl都要执行该语句)
sudo service ssh --full-restart
4、重新生成host key
sudo dpkg-reconfigure openssh-serve
5、连接XShell
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)