先备份

sudo cp /etc/apt/source.list /opt

粘贴清华源

sudo vim /etc/apt/source.list   
然后添加编写清华源
sudo apt update

本地子系统开启xshell连接

#安装ssh-server
sudo apt install openssh-server ssh -y

设置root密码

passwd root

允许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

标签: root, etc, sudo, apt, xshell, ssh, WSL, APT

相关文章推荐

添加新评论,含*的栏目为必填