实验室服务器docker里面ssh连不上,start-stop-daemon: matching on world-writable pidfile /run/sshd.pid is insecure

实验室服务器docker里面ssh连不上,start-stop-daemon: matching on world-writable pidfile /run/sshd.pid is insecure_第1张图片

容器内提前安装了ssh

进入容器之后启动ssh

报错。说什么不安全(我不管,我就要连接,xkl还要跑深度学习,说如果我成功了,每天给我买一杯库迪咖啡)

注意修改权限的操作要在容器内,要是在ubuntu里面改错了权限,可能后果很严重

(base) dell@dell-Precision-7920-Tower:~$ docker attach xkl
root@fba4c66f7f2c:/# service ssh start
 * Starting OpenBSD Secure Shell server sshd                                                                              start-stop-daemon: matching on world-writable pidfile /run/sshd.pid is insecure
[fail]
root@fba4c66f7f2c:/# chmod 600 /run/sshd.pid
root@fba4c66f7f2c:/# service ssh start
 * Starting OpenBSD Secure Shell server sshd                                                                              
 /  run/sshd must be owned by root and not group or world-writable.
[fail]
root@fba4c66f7f2c:/# rm -rf /var/run/sshd/
root@fba4c66f7f2c:/# service ssh restart
 * Restarting OpenBSD Secure Shell server sshd                                                                     [ OK ] 
root@fba4c66f7f2c:/# 

如果出现了下面的情况

实验室服务器docker里面ssh连不上,start-stop-daemon: matching on world-writable pidfile /run/sshd.pid is insecure_第2张图片

 

(同样是在容器内。)就这样

root@7a034721befb:/#  chmod 600 /etc/ssh/ssh_host_ecdsa_key 
root@7a034721befb:/# chmod 600 /etc/ssh/ssh_host_ed25519_key 
root@7a034721befb:/# chmod 600 /etc/ssh/ssh_host_rsa_key 

 

 

你可能感兴趣的:(服务器,docker,ssh)