apt-get remove openssh-servervim
apt-get install openssh-serverssh
vim /etc/ssh/sshd_configspa
PasswordAuthentication yes
容许密码登陆service ssh --full-restart.net
注:1,登陆 Linux 子系统使用默认帐号,默认的帐号不是
root
rest2,Linux 子系统跟本机 IP 同样。code
参考:https://blog.csdn.net/l_d_x/article/details/9497984server
启用 root 设置密码并设置容许 ssh 登陆:http://www.javashuo.com/article/p-ahbxhbbv-dx.htmlblog
sudo systemctl restart ssh 可用 service ssh restart 代替rem