sudo cp /etc/apt/source.list /opt
sudo vim /etc/apt/source.list
然后添加编写清华源
sudo apt update
#安装ssh-server
sudo apt install openssh-server ssh -y
passwd root
vim /etc/ssh/sshd_config
去掉注释并且将PermitRootLogin 改成 PermitRootLogin yes
并且将PasswordAuthentication no 改成 PasswordAuthentication yes(这个不改则导致不能使用用户名密码登录)
最终可以使用xshell 连接子系统 IP地址就是win10的以太网地址
以下内容可能是多余的
#生成ssh密钥
执行下面命令,然后三次回车即可生成(dsa算法)
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
#重启ssh服务
sudo service ssh --full-restart
原文:https://www.cnblogs.com/linux008/p/15023460.html