# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN 8047/Xvnc
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 8047/Xvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 8047/Xvnc
这三个端口分别代表什么?
“For each session number, VNC will listen on three different network sockets. If N is the session number, VNC server will listen on 5800 + N for HTTP connections, on 5900 + N for VNC RFB connections and on 6000 + N. This last port allows X applications to connect to the VNC server. So in our case, the ports that VNC uses are 5801, 5901 and 6001.”
5801 是由 java applet 使用,也就是网页版 b/s 模型;5901 是使用 RFB 协议实现的 c/s 模型;二者选择一个即可。6001 让 X 应用连接 server。
一个 VNC 默认开了 3 个端口,个人认为即使认证跟连接都用 RSA 加密,也是很不安全的,ftp 这种不过才开了 2 个端口。
参考:
http://www.linuxjournal.com/article/5560