這台機器運行 LAMP 堆疊(httpd、mariadb 和 php),Web 伺服器和 ssh 都在運行,但無法從遠端系統存取。該問題在一小時前隨機出現,系統立即變得無響應(無論是透過我現有的 ssh 連接還是透過 httpd)。
系統目前已啟動並可透過 iDRAC 訪問,我可以在終端機中透過 iDRAC 登入並發出命令。
firewalld
處於活動狀態並顯示 http、https 和 ssh 連接埠已啟用(等等)。停止firewalld
服務並不能解決問題。
nmap
顯示不同的結果(從伺服器發出的命令)。
nmap localhost -p 22
Host is up
22/tcp open ssh
如果我使用以下命令指定伺服器的 IP 或 FQDN nmap
:
nmap xxx.xxx.xxx.xxx -p 22
Note: Host seems down
nmap
來自遠端系統的相同檢查顯示主機已啟動:
acoder@lappy ~ $ nmap my.domain.name -p 22
Starting Nmap 7.80 ( https://nmap.org ) at 2022-12-10 08:52 EST
Nmap scan report for my.domain.name (xxx.xxx.xxx.xxx)
Host is up (0.014s latency).
PORT STATE SERVICE
22/tcp filtered ssh
Nmap done: 1 IP address (1 host up) scanned in 0.29 seconds
sshd
已啟動並正在運行
如果我設定了本機金鑰,我可能可以透過 localhost 登入 ssh
ssh localhost
它授予權限被拒絕(由於我沒有設定密鑰)
如果我發出相同的命令但指定伺服器的實際 IP:
ssh xxx.xxx.xxx.xxx
ssh
回報Connection timed out
ssh my.domain.name
從遠端系統發出時,我得到Connection refused
:
acoder@lappy ~ $ ssh -vvv my.domain.name
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "my.domain.name" port 22
debug2: ssh_connect_direct
debug1: Connecting to my.domain.name [xxx.xxx.xxx.xxx] port 22.
debug1: connect to address xxx.xxx.xxx.xxx port 22: Connection refused
ssh: connect to host my.domain.name port 22: Connection refused
從伺服器telnet
拒絕連接埠 22 上的連線:
[[email protected]]# telnet localhost 22
Trying 127.0.0.1...
Connect3ed to localhost.
Escape character is '^]'.
SSH-2.0-OpenSSH7.4
Connection refused by foreign host.
[[email protected]]#
我可以從該伺服器透過 ssh 連接到其他伺服器。只是不喜歡而已。
我在網路裝置上顯示活動連結指示燈:
ethtool em1
相反,如果nmap
從遠端系統檢查時顯示連接埠 443 可用:
acoder@lappy ~ $ nmap my.domain.name -p 443
Starting Nmap 7.80 ( https://nmap.org ) at 2022-12-09 23:59 EST
Nmap scan report for my.domain.name (xxx.xxx.xxx.xxx)
Host is up (0.013s latency).
PORT STATE SERVICE
443/tcp filtered https
Nmap done: 1 IP address (1 host up) scanned in 0.41 seconds
在瀏覽器中存取相同網域會產生“無法連線”
tcpdump -D
:
這是輸出tcpdump -i em1 port 22
:
我可以從該伺服器 ping 我們的 DNS 伺服器。該伺服器能夠在其他伺服器上安裝共用磁碟機。
我在這裡還缺什麼?