docker 容器(container)使用ssh服务登录一段时间无操作后自动断开问题解决

如题,ssh登录建立好的docker容器,无操作一段时间后,发现ssh自动断开:

 

 

解决方法:

修改配置文件

 

/ect/ssh/sshd_config

 

 

 

在文件最后添加下面内容:

PermitRootLogin yes
UsePAM no

ClientAliveInterval 30
ClientAliveCountMax 86400

 

 

 

 

 

 

 

然后,从前 sshd  服务:

 

sudo sshd restart

 

 

 

 

 

 

 

 

 

 

参考:

https://blog.csdn.net/yhcharles/article/details/51063486

http://www.89cool.com/602.html

 https://blog.csdn.net/ownfire/article/details/70156959

 

posted on 2021-07-04 20:29  Angry_Panda  阅读(529)  评论(1编辑  收藏  举报

导航