apt-get remove openssh-server
apt-get install openssh-server
vim /etc/ssh/sshd_config
PasswordAuthentication yes
允许密码登录service ssh --full-restart
注:1,登录 Linux 子系统使用默认账号,默认的账号不是
root
2,Linux 子系统跟本机 IP 一样。
参考:https://blog.youkuaiyun.com/l_d_x/article/details/9497984
启用 root 设置密码并设置允许 ssh 登录:https://blog.youkuaiyun.com/a496298685/article/details/86821306
sudo systemctl restart ssh 可用 service ssh restart 代替