wsl openssh安装
1、卸载openssh
sudo apt remove openssh-server
2、设置软件源
修改/etc/apt/sources.list为下面内容,使用vi时先按下i再粘贴,不然格式是乱的
然后suo apt-get update
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
3、安装
sudo apt install openssh-server
提示
openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu2.13) but 1:7.6p1-4ubuntu0.3 is to be installed
sudo apt install openssh-server
4、修改sshd_config
sudo sed -i '/PermitRootLogin /c PermitRootLogin yes' /etc/ssh/sshd_config
sudo sed -i '/PasswordAuthentication /c PasswordAuthentication yes' /etc/ssh/sshd_config
sudo sed -i '/Port /c Port 221' /etc/ssh/sshd_config
5、重启ssh
sudo systemctl start sshd的时候
System has not been booted with systemd as init system (PID 1). Can't operate.
可使用
sudo /etc/init.d/ssh restart
或者
sudo service ssh restart
本博客是个人工作中记录,更深层次的问题可以提供有偿技术支持。
另外建了几个QQ技术群:
2、全栈技术群:616945527
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600
闲置域名WWW.EXAI.CN (超级人工智能)出售。
另外建了几个QQ技术群:
2、全栈技术群:616945527
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600
闲置域名WWW.EXAI.CN (超级人工智能)出售。