sshd 未在 rhel 7.7 上啟動

sshd 未在 rhel 7.7 上啟動

sshd.service 作業失敗,因為控制進程退出並顯示錯誤代碼。

> -- Unit sshd.service has begun starting up. ctl sshd[4845]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. ctl
> sshd[4845]: error: Bind to port 22 on :: failed: Address already in
> use. ctl sshd[4845]: fatal: Cannot bind any address. ctl systemd[1]:
> sshd.service: main process exited, code=exited, status=255/n/a ctl
> audispd[584]: node=servername type=CRYPTO_KEY_USER
> msg=audit(xxx.xx:yyyy): pid=4845 uid=0 auid=4294967295 ses=4294967295
> subj=system_u:syste Mar 08 12:07:00 ctl systemd[1]: Failed to start
> OpenSSH server daemon.
> -- Subject: Unit sshd.service has failed
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> -- Unit sshd.service has failed.
> -- The result is failed. Mar 08 12:07:00 ctl audispd[584]: node=servername type=CRYPTO_KEY_USER msg=audit(1583669220.759:5500):
> pid=4845 uid=0 auid=4294967295 ses=4294967295 subj=system_u:syste Mar
> 08 12:07:00 ctl systemd[1]: Unit sshd.service entered failed state.
> Mar 08 12:07:00 ctl audispd[584]: node=servername type=CRYPTO_KEY_USER
> msg=audit(1583669220.759:5501): pid=4845 uid=0 auid=4294967295
> ses=4294967295 subj=system_u:syste Mar 08 12:07:00 ctl systemd[1]:
> sshd.service failed. Mar 08 12:07:00 ctl audispd[584]: node=servername
> type=SERVICE_START msg=audit(1583669220.760:5502): pid=1 uid=0
> auid=4294967295 ses=4294967295 subj=system_u:system_r:i [root@server
> conf]# :system_r:init_t:s0 msg='unit=sshd comm="systemd"
> exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=?
> res=failed' M

我嘗試檢查監聽連接埠 22 的服務

netstat -tunlp | grep 22

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1023/sshd

tcp6       0      0 :::22                   :::*                    LISTEN      1023/sshd

我看到 tcp6 和 tcp 正在偵聽連接埠 22,並嘗試停用 ipv6

引用的並禁用 ipv6

對 /etc/sysctl.conf 進行了更改

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

也編輯了 grub /etc/default/grub並且加入了ipv6.disable=1

即使重新啟動後,我也無法在連接埠 22 上停用 tcp6。

正在運行的進程列表

ps -ef | grep sshd
root     1023     1  0 13:15 ?        00:00:00 /usr/share/centrifydc/sbin/sshd -D
root      1899  1023  0 13:15 ?        00:00:00 sshd: ec2-user [priv]
root      1900  1023  0 13:15 ?        00:00:00 sshd: ec2-user [priv]
ec2-user  1994  1900  0 13:15 ?        00:00:00 sshd: ec2-user
ec2-user  1996  1899  0 13:15 ?        00:00:00 sshd: ec2-user@pts/0
root      3282  3268  0 13:22 pts/0    00:00:00 grep --color=auto sshd

一旦我殺死了 Centrify 進程,我就能夠啟動 sshd 進程。

謝謝內特

答案1

正在運行的進程列表

ps -ef | grep sshd
root     1023     1  0 13:15 ?        00:00:00 /usr/share/centrifydc/sbin/sshd -D
root      1899  1023  0 13:15 ?        00:00:00 sshd: ec2-user [priv]
root      1900  1023  0 13:15 ?        00:00:00 sshd: ec2-user [priv]
ec2-user  1994  1900  0 13:15 ?        00:00:00 sshd: ec2-user
ec2-user  1996  1899  0 13:15 ?        00:00:00 sshd: ec2-user@pts/0
root      3282  3268  0 13:22 pts/0    00:00:00 grep --color=auto sshd 

一旦我殺死了 Centrify 進程,我就能夠啟動 sshd 進程。感謝 Ulrich 和 Jeff 幫忙解決問題。

相關內容