Windows子系统Ubuntu开启远程连接

更新资源sudo apt-get update对软件进行升级【Windows子系统Ubuntu开启远程连接】sudoapt-getupgrade升级系统版本sudoapt-getdist-upgrade安装openssh-serversudo apt-get install openssh-server查看ssh服务是否开启ps -e |grep ssh启动服务sudo /etc/init.d/ssh restart报错处理root@DESKTOP-R5E7NDM:~# sudo /etc/init.d/ssh restartCould not load host key: /etc/ssh/ssh_host_rsa_keyCould not load host key: /etc/ssh/ssh_host_ecdsa_keyCould not load host key: /etc/ssh/ssh_host_ed25519_key * Restarting OpenBSD Secure Shell server sshdCould not load host key: /etc/ssh/ssh_host_rsa_keyCould not load host key: /etc/ssh/ssh_host_ecdsa_keyCould not load host key: /etc/ssh/ssh_host_ed25519_key cd /etc/ssh/ ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_keyssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_keyssh-keygen -t rsa -f /etc/ssh/ssh_host_ecdsa_keyssh-keygen -t rsa -f /etc/ssh/ssh_host_ed25519_key修改配置vim /etc/ssh/sshd_config进入/etc/ssh/sshd_config查找PermitRootLogin选项(可以利用:/PermitRootLogin的方法进行查找) 将这个选项后面的值(一般为prohibit-password)修改为yes其他apt install openssh-server#安装openssh-serverservice ssh start#启动openssh-serverps -e |grep sshd#查看ssh服务是否启动-e查看全部进程service ssh status#查看ssh运行状态service ssh restart#重启



    推荐阅读