Docker 的 CentOs 问题 - 一旦 Docker 初学者无法从中创建新会话

CentOs issue with the Docker - once Docker starter unable to create new session out of it

我无法使用 sshftp 或使用 putty 登录我的 CentOs 服务器,我收到此错误:

Network error: Connection refused 

我在 putty 服务器上有 1 个活动会话,但奇怪的是新会话无法启动。

[root@ech-10-XXX ~]# uname -a
Linux ech-10-XX 4.1.12-61.1.18.el7uek.x86_64 #2 SMP Fri Nov 4 15:48:30 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

我在执行此操作时遇到以下错误:

service sshd start
Redirecting to /bin/systemctl start sshd.service
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.

其他详情:

systemctl status sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2018-09-12 01:02:28 CDT; 37s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 14367 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
 Main PID: 14367 (code=exited, status=255)

Sep 12 01:02:28 10-XX systemd[1]: Failed to start OpenSSH server daemon.
Sep 12 01:02:28 10-XX systemd[1]: Unit sshd.service entered failed state.
Sep 12 01:02:28 10-XX systemd[1]: sshd.service failed.

然后我做了semanage port -a -t ssh_port_t -p tcp 2222

进程状态:

ps aux | grep sshd
root      1027  0.0  0.0  82480  6132 ?        Ss   00:25   0:00 /usr/sbin/sshd -f /etc/ssh/sshd_config-SCP -D
root      1029  0.0  0.0  82480  6064 ?        Ss   00:25   0:00 /usr/sbin/sshd -f /etc/ssh/sshd_config-UA -D
root      2999  0.0  0.1 145068  8908 ?        Ss   00:26   0:00 sshd: dc-user [priv]
dc-user   3001  0.0  0.0 145068  3944 ?        S    00:26   0:01 sshd: dc-user@pts/0
root     14399  0.0  0.0 112720  2280 pts/0    S+   01:06   0:00 grep --color=auto sshd

我可以通过以下方式解决这个问题 -

1) su - root

2) chmod 755 /var/empty/sshd

3) 服务 sshd 重启