Centos
即使埠已清除,在特定埠上創建 VNC 會話也會失敗
預先為大量的命令輸出文本感到抱歉,我認為這比解釋自己更清楚。
我正在使用 CentOS 7 和tigervnc:
(base) [carlos@pulsar .vnc]$ cat /etc/centos-release CentOS Linux release 7.7.1908 (Core) (base) [carlos@pulsar .vnc]$ yum list installed | grep tigervnc Skipping unreadable repository '/etc/yum.repos.d/github_git-lfs.repo' Skipping unreadable repository '/etc/yum.repos.d/perforce.repo' Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast tigervnc.x86_64 1.8.0-17.el7 @base tigervnc-icons.noarch 1.8.0-17.el7 @base tigervnc-license.noarch 1.8.0-17.el7 @base tigervnc-server.x86_64 1.8.0-17.el7 @base tigervnc-server-minimal.x86_64 1.8.0-17.el7 @base
當嘗試在顯示:16(對應於埠 5916)上啟動 vnc 會話時,我收到此錯誤,
(base) [carlos@pulsar ~]$ vncserver :16 A VNC server is already running as :16 New 'pulsar:20 (carlos)' desktop is pulsar:20 Starting applications specified in /home/carlos/.vnc/xstartup Log file is /home/carlos/.vnc/pulsar:20.log (base) [carlos@pulsar ~]$ vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID :17 22581 :20 222978
我已經習慣了,所以我開始尋找罪魁禍首。
檢查是否有鎖:否
(base) [carlos@pulsar ~]$ ls -l /tmp/.X* -r--r--r--. 1 carlos phoelex 11 Mar 16 19:17 /tmp/.X20-lock -r--r--r--. 1 bindu phoelex 11 Mar 16 14:05 /tmp/.X28-lock /tmp/.X11-unix: total 0 srwxrwxrwx. 1 amir phoelex 0 Nov 18 13:35 X1 srwxrwxrwx. 1 stuart phoelex 0 Nov 18 13:35 X10 srwxrwxrwx. 1 ranga phoelex 0 Nov 18 13:35 X11 srwxrwxrwx. 1 scott phoelex 0 Dec 18 13:49 X13 srwxrwxrwx. 1 pablo phoelex 0 Nov 18 15:05 X14 srwxrwxrwx. 1 zak phoelex 0 Nov 18 13:35 X15 srwxrwxrwx. 1 carlos phoelex 0 Nov 18 13:35 X17 srwxrwxrwx. 1 marco phoelex 0 Nov 18 13:35 X18 srwxrwxrwx. 1 michal phoelex 0 Nov 18 13:35 X19 srwxrwxrwx. 1 greg greg 0 Nov 18 13:35 X2 srwxrwxrwx. 1 carlos phoelex 0 Mar 16 19:17 X20 srwxrwxrwx. 1 candido phoelex 0 Nov 18 14:11 X23 srwxrwxrwx. 1 mihai phoelex 0 Nov 18 14:00 X25 srwxrwxrwx. 1 hakim phoelex 0 Jan 20 18:41 X26 srwxrwxrwx. 1 bindu phoelex 0 Mar 16 14:05 X28 srwxrwxrwx. 1 michal phoelex 0 Nov 18 13:51 X3 srwxrwxrwx. 1 candido phoelex 0 Feb 2 22:47 X33 srwxrwxrwx. 1 andrew phoelex 0 Nov 20 13:03 X4 srwxrwxrwx. 1 candido phoelex 0 Nov 18 14:11 X44 srwxrwxrwx. 1 ed phoelex 0 Nov 18 13:35 X5 srwxrwxrwx. 1 leighton phoelex 0 Nov 18 13:35 X50 srwxrwxrwx. 1 kathryn phoelex 0 Nov 18 13:35 X6 srwxrwxrwx. 1 candido phoelex 0 Nov 18 14:11 X66 srwxrwxrwx. 1 candido phoelex 0 Nov 18 14:11 X77 srwxrwxrwx. 1 simon phoelex 0 Dec 2 16:10 X8 srwxrwxrwx. 1 valerio phoelex 0 Nov 18 13:35 X9 srwxrwxrwx. 1 candido phoelex 0 Nov 18 14:11 X99 /tmp/.XIM-unix: total 0
檢查是否有任何 Xvnc 程序使用該顯示:否
(base) [carlos@pulsar ~]$ ps -ef | grep Xvnc bindu 5815 1 0 14:05 ? 00:00:00 /usr/bin/Xvnc :28 -auth /home/bindu/.Xauthority -desktop pulsar:28 (bindu) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/bindu/.vnc/passwd -rfbport 5928 -rfbwait 30000 scott 6368 1 0 2020 ? 00:05:09 /usr/bin/Xvnc :13 -auth /home/scott/.Xauthority -desktop pulsar:13 (scott) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/scott/.vnc/passwd -rfbport 5913 -rfbwait 30000 stuart 21911 1 0 2020 ? 1-04:07:56 /usr/bin/Xvnc :10 -auth /home/stuart/.Xauthority -desktop pulsar:10 (stuart) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/stuart/.vnc/passwd -rfbport 5910 -rfbwait 30000 kathryn 22580 1 0 2020 ? 01:28:35 /usr/bin/Xvnc :6 -auth /home/kathryn/.Xauthority -desktop pulsar:6 (kathryn) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/kathryn/.vnc/passwd -rfbport 5906 -rfbwait 30000 carlos 22581 1 0 2020 ? 11:55:01 /usr/bin/Xvnc :17 -auth /home/carlos/.Xauthority -desktop pulsar:17 (carlos) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/carlos/.vnc/passwd -rfbport 5917 -rfbwait 30000 ed 22583 1 0 2020 ? 00:05:02 /usr/bin/Xvnc :5 -auth /home/ed/.Xauthority -desktop pulsar:5 (ed) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/ed/.vnc/passwd -rfbport 5905 -rfbwait 30000 amir 22586 1 0 2020 ? 00:31:29 /usr/bin/Xvnc :1 -auth /home/amir/.Xauthority -desktop pulsar:1 (amir) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/amir/.vnc/passwd -rfbport 5901 -rfbwait 30000 ranga 22587 1 6 2020 ? 7-11:43:15 /usr/bin/Xvnc :11 -auth /home/ranga/.Xauthority -desktop pulsar:11 (ranga) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/ranga/.vnc/passwd -rfbport 5911 -rfbwait 30000 zak 22588 1 0 2020 ? 00:05:09 /usr/bin/Xvnc :15 -auth /home/zak/.Xauthority -desktop pulsar:15 (zak) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/zak/.vnc/passwd -rfbport 5915 -rfbwait 30000 marco 22589 1 0 2020 ? 00:00:00 /usr/bin/Xvnc :18 -auth /home/marco/.Xauthority -desktop pulsar:18 (marco) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/marco/.vnc/passwd -rfbport 5918 -rfbwait 30000 valerio 22590 1 0 2020 ? 00:21:37 /usr/bin/Xvnc :9 -auth /home/valerio/.Xauthority -desktop pulsar:9 (valerio) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/valerio/.vnc/passwd -rfbport 5909 -rfbwait 30000 greg 22591 1 0 2020 ? 01:05:06 /usr/bin/Xvnc :2 -auth /home/greg/.Xauthority -desktop pulsar:2 (greg) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2107 -pn -rfbauth /home/greg/.vnc/passwd -rfbport 5902 -rfbwait 30000 leighton 22592 1 0 2020 ? 00:00:00 /usr/bin/Xvnc :50 -auth /home/leighton/.Xauthority -desktop pulsar:50 (leighton) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/leighton/.vnc/passwd -rfbport 5950 -rfbwait 30000 michal 22593 1 0 2020 ? 05:05:55 /usr/bin/Xvnc :19 -auth /home/michal/.Xauthority -desktop pulsar:19 (michal) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/michal/.vnc/passwd -rfbport 5919 -rfbwait 30000 ext-gue+ 26418 26214 0 2020 pts/0 00:02:22 /usr/bin/Xvnc :7 -auth /home/ext-guest/.Xauthority -desktop pulsar:7 () -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/ext-guest/.vnc/passwd -rfbport 5907 -rfbwait 30000 ext-jiri 26446 26212 0 2020 pts/0 00:04:36 /usr/bin/Xvnc :12 -auth /home/ext-jiri/.Xauthority -desktop pulsar:12 () -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/ext-jiri/.vnc/passwd -rfbport 5912 -rfbwait 30000 michal 34129 1 0 2020 ? 00:04:41 /usr/bin/Xvnc :3 -auth /home/michal/.Xauthority -desktop pulsar:3 (michal) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/michal/.vnc/passwd -rfbport 5903 -rfbwait 30000 mihai 35252 1 2 2020 ? 3-10:20:08 /usr/bin/Xvnc :25 -auth /home/mihai/.Xauthority -desktop pulsar:25 (mihai) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/mihai/.vnc/passwd -rfbport 5925 -rfbwait 30000 candido 38366 1 0 2020 ? 17:13:51 /usr/bin/Xvnc :23 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:23 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5923 -rfbwait 30000 candido 38417 1 0 2020 ? 06:14:52 /usr/bin/Xvnc :44 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:44 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5944 -rfbwait 30000 candido 39445 1 0 2020 ? 00:08:03 /usr/bin/Xvnc :66 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:66 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5966 -rfbwait 30000 candido 40622 1 0 2020 ? 00:05:32 /usr/bin/Xvnc :77 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:77 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5977 -rfbwait 30000 candido 41288 1 0 2020 ? 04:14:29 /usr/bin/Xvnc :99 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:99 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5999 -rfbwait 30000 pablo 52358 1 0 2020 ? 04:15:07 /usr/bin/Xvnc :14 -auth /home/pablo/.Xauthority -desktop pulsar:14 (pablo) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/pablo/.vnc/passwd -rfbport 5914 -rfbwait 30000 andrew 95615 1 0 2020 ? 01:11:49 /usr/bin/Xvnc :4 -auth /home/andrew/.Xauthority -desktop pulsar:4 (andrew) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/andrew/.vnc/passwd -rfbport 5904 -rfbwait 30000 candido 177587 1 0 Feb02 ? 00:10:23 /usr/bin/Xvnc :33 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:33 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5933 -rfbwait 30000 hakim 218843 1 0 Jan20 ? 02:20:58 /usr/bin/Xvnc :26 -auth /home/hakim/.Xauthority -desktop pulsar:26 (hakim) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/hakim/.vnc/passwd -rfbport 5926 -rfbwait 30000 carlos 222978 1 0 19:17 pts/182 00:00:00 /usr/bin/Xvnc :20 -auth /home/carlos/.Xauthority -desktop pulsar:20 (carlos) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/carlos/.vnc/passwd -rfbport 5920 -rfbwait 30000 simon 229121 1 2 2020 ? 2-19:19:09 /usr/bin/Xvnc :8 -auth /home/simon/.Xauthority -desktop pulsar:8 (simon) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2080 -pn -rfbauth /home/simon/.vnc/passwd -rfbport 5908 -rfbwait 30000 carlos 237583 126579 0 19:22 pts/182 00:00:00 grep --color=auto Xvnc (base) [carlos@pulsar .vnc]$ pgrep Xvnc --list-full 5815 /usr/bin/Xvnc :28 -auth /home/bindu/.Xauthority -desktop pulsar:28 (bindu) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/bindu/.vnc/passwd -rfbport 5928 -rfbwait 30000 6368 /usr/bin/Xvnc :13 -auth /home/scott/.Xauthority -desktop pulsar:13 (scott) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/scott/.vnc/passwd -rfbport 5913 -rfbwait 30000 21911 /usr/bin/Xvnc :10 -auth /home/stuart/.Xauthority -desktop pulsar:10 (stuart) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/stuart/.vnc/passwd -rfbport 5910 -rfbwait 30000 22580 /usr/bin/Xvnc :6 -auth /home/kathryn/.Xauthority -desktop pulsar:6 (kathryn) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/kathryn/.vnc/passwd -rfbport 5906 -rfbwait 30000 22581 /usr/bin/Xvnc :17 -auth /home/carlos/.Xauthority -desktop pulsar:17 (carlos) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/carlos/.vnc/passwd -rfbport 5917 -rfbwait 30000 22583 /usr/bin/Xvnc :5 -auth /home/ed/.Xauthority -desktop pulsar:5 (ed) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/ed/.vnc/passwd -rfbport 5905 -rfbwait 30000 22586 /usr/bin/Xvnc :1 -auth /home/amir/.Xauthority -desktop pulsar:1 (amir) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/amir/.vnc/passwd -rfbport 5901 -rfbwait 30000 22587 /usr/bin/Xvnc :11 -auth /home/ranga/.Xauthority -desktop pulsar:11 (ranga) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/ranga/.vnc/passwd -rfbport 5911 -rfbwait 30000 22588 /usr/bin/Xvnc :15 -auth /home/zak/.Xauthority -desktop pulsar:15 (zak) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/zak/.vnc/passwd -rfbport 5915 -rfbwait 30000 22589 /usr/bin/Xvnc :18 -auth /home/marco/.Xauthority -desktop pulsar:18 (marco) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/marco/.vnc/passwd -rfbport 5918 -rfbwait 30000 22590 /usr/bin/Xvnc :9 -auth /home/valerio/.Xauthority -desktop pulsar:9 (valerio) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/valerio/.vnc/passwd -rfbport 5909 -rfbwait 30000 22591 /usr/bin/Xvnc :2 -auth /home/greg/.Xauthority -desktop pulsar:2 (greg) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2107 -pn -rfbauth /home/greg/.vnc/passwd -rfbport 5902 -rfbwait 30000 22592 /usr/bin/Xvnc :50 -auth /home/leighton/.Xauthority -desktop pulsar:50 (leighton) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/leighton/.vnc/passwd -rfbport 5950 -rfbwait 30000 22593 /usr/bin/Xvnc :19 -auth /home/michal/.Xauthority -desktop pulsar:19 (michal) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/michal/.vnc/passwd -rfbport 5919 -rfbwait 30000 26418 /usr/bin/Xvnc :7 -auth /home/ext-guest/.Xauthority -desktop pulsar:7 () -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/ext-guest/.vnc/passwd -rfbport 5907 -rfbwait 30000 26446 /usr/bin/Xvnc :12 -auth /home/ext-jiri/.Xauthority -desktop pulsar:12 () -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/ext-jiri/.vnc/passwd -rfbport 5912 -rfbwait 30000 34129 /usr/bin/Xvnc :3 -auth /home/michal/.Xauthority -desktop pulsar:3 (michal) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/michal/.vnc/passwd -rfbport 5903 -rfbwait 30000 35252 /usr/bin/Xvnc :25 -auth /home/mihai/.Xauthority -desktop pulsar:25 (mihai) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/mihai/.vnc/passwd -rfbport 5925 -rfbwait 30000 38366 /usr/bin/Xvnc :23 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:23 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5923 -rfbwait 30000 38417 /usr/bin/Xvnc :44 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:44 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5944 -rfbwait 30000 39445 /usr/bin/Xvnc :66 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:66 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5966 -rfbwait 30000 40622 /usr/bin/Xvnc :77 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:77 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5977 -rfbwait 30000 41288 /usr/bin/Xvnc :99 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:99 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5999 -rfbwait 30000 52358 /usr/bin/Xvnc :14 -auth /home/pablo/.Xauthority -desktop pulsar:14 (pablo) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/pablo/.vnc/passwd -rfbport 5914 -rfbwait 30000 95615 /usr/bin/Xvnc :4 -auth /home/andrew/.Xauthority -desktop pulsar:4 (andrew) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/andrew/.vnc/passwd -rfbport 5904 -rfbwait 30000 115649 /usr/bin/Xvnc :21 -auth /home/humberto/.Xauthority -desktop pulsar:21 (humberto) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/humberto/.vnc/passwd -rfbport 5921 -rfbwait 30000 177587 /usr/bin/Xvnc :33 -auth /home/candido/.Xauthority -depth 24 -desktop pulsar:33 (candido) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/candido/.vnc/passwd -rfbport 5933 -rfbwait 30000 218843 /usr/bin/Xvnc :26 -auth /home/hakim/.Xauthority -desktop pulsar:26 (hakim) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2160 -pn -rfbauth /home/hakim/.vnc/passwd -rfbport 5926 -rfbwait 30000 222978 /usr/bin/Xvnc :20 -auth /home/carlos/.Xauthority -desktop pulsar:20 (carlos) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/carlos/.vnc/passwd -rfbport 5920 -rfbwait 30000 229121 /usr/bin/Xvnc :8 -auth /home/simon/.Xauthority -desktop pulsar:8 (simon) -fp catalogue:/etc/X11/fontpath.d -geometry 3840x2080 -pn -rfbauth /home/simon/.vnc/passwd -rfbport 5908 -rfbwait 30000
檢查對應埠是否有程序監聽:否
(base) [carlos@pulsar ~]$ sudo netstat -ltnp | grep -w ':5916' (base) [carlos@pulsar ~]$ sudo netstat -ltnp | grep -w ':6016'
為了比較,這是一個工作 VNC 會話:
(base) [carlos@pulsar ~]$ sudo netstat -ltnp | grep -w ':5917' tcp6 0 0 :::5917 :::* LISTEN 22581/Xvnc (base) [carlos@pulsar ~]$ sudo netstat -ltnp | grep -w ':6017' tcp6 0 0 :::6017 :::* LISTEN 22581/Xvnc
檢查埠是否打開:是
(base) [carlos@pulsar ~]$ sudo firewall-cmd --permanent --zone=public --add-port=5916/tcp Warning: ALREADY_ENABLED: 5916:tcp success (base) [carlos@pulsar ~]$ sudo firewall-cmd --reload success
所以我嘗試從伺服器本身遠端登錄:
(base) [carlos@pulsar .vnc]$ telnet localhost 5916 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused
在工作會話的情況下,我可以連接:
(base) [carlos@pulsar .vnc]$ telnet localhost 5917 Trying ::1... Connected to localhost. Escape character is '^]'. RFB 003.008 ^CConnection closed by foreign host.
從同一 LAN 中的不同機器掃描埠時:
(base) [carlos@blazar ~]$ nmap pulsar.phoelex.com -Pn -p 5916 Starting Nmap 6.40 ( http://nmap.org ) at 2021-03-16 19:32 GMT Nmap scan report for pulsar.phoelex.com (192.168.1.33) Host is up (0.00028s latency). PORT STATE SERVICE 5916/tcp closed unknown Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds (base) [carlos@blazar ~]$ nmap pulsar.phoelex.com -Pn -p 5917 Starting Nmap 6.40 ( http://nmap.org ) at 2021-03-16 19:33 GMT Nmap scan report for pulsar.phoelex.com (192.168.1.33) Host is up (0.00035s latency). PORT STATE SERVICE 5917/tcp open unknown Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
查看 IP 表,IN_public_allow/deny 部分:
(base) [carlos@pulsar .vnc]$ sudo iptables -L -n Chain IN_public_allow (1 references) target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:137 ctstate NEW,UNTRACKED ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:138 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:139 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:445 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5901 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5902 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5915 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5913 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5917 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5916 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5908 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5914 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5009 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5909 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5921 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5920 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5922 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5904 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5905 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5906 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5950 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5918 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5919 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5910 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5911 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:111 ctstate NEW,UNTRACKED ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:111 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2049 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:24007 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:24008 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5907 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5923 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5924 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5925 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5903 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5926 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5928 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5912 ctstate NEW,UNTRACKED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5927 ctstate NEW,UNTRACKED Chain IN_public_deny (1 references) target prot opt source destination
在這一點上,我不知道是什麼導致了這種情況,並開始擔心它可能是惡意的。任何進一步調試此問題的步驟將不勝感激。
不是真正的解決方案,但由於不相關的原因我們不得不重新啟動伺服器,問題已經消失。