我在我的 Ubuntu 服务器上安装了 TigerVNC 服务器,但我无法连接到它。服务器正在运行,但是当我尝试使用手机扫描打开的端口(在 LAN 中)时,5901 已关闭。
输出nmap localhost
:
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-25 08:02 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00026s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
631/tcp open ipp
5901/tcp open vnc-1
Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds
我认为问题就在这里。输出nmap 192.168.0.101
:
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-25 08:05 UTC
Nmap scan report for cloud.local (192.168.0.101)
Host is up (0.00039s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.58 seconds
我已经尝试过的:
- 在防火墙中允许端口 5901/tcp
- 禁用防火墙并重新启动
编辑:
输出nmap 192.168.0.101 -p 5900-5901
:
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-25 09:50 UTC
Nmap scan report for cloud.local (192.168.0.101)
Host is up (0.00032s latency).
PORT STATE SERVICE
5900/tcp closed vnc
5901/tcp closed vnc-1
Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
我问了另一个问题,这是特定于 TigerVNC 服务器的。
来自https://askubuntu.com/a/1254109/1027810:
您是否首先与要登录的用户开始会话?我建议你遵循一些关于如何运行tigervnc 服务器的教程。VNC 服务器默认不是 apache2 之类的守护进程,例如 mysql。这意味着您必须首先手动启动服务器。但是一些教程也会向您展示如何“守护”它们。