XShell初次连接WSL2教程

最后编辑时间: 2022-11-15

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

 

请在下方留下您的评论.加入TG吹水群