1)首先安装WSL
2)sudo apt-get update
sudo apt remove openssh-server
sudo apt install openssh-server
3)Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
Change Port to 2222 (or any other port above 1000)
Change UsePrivilegeSeparation to no
Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
Restart the ssh server:
sudo service ssh --full-restart
refer:https://gist.github.com/dentechy/de2be62b55cfd234681921d5a8b6be11
网友评论