在Ubuntu系统中,如果你使用TigerVNC并希望修改其默认端口,可以按照以下步骤操作:
/etc/tigervnc.conf
或~/.vnc/xstartup
。nano
或vim
)打开配置文件。[Server]
Port=5900
Port=5900
中的5900
替换为你想要使用的端口号。sudo systemctl restart vncserver
或者,如果你是通过手动启动的VNC服务器,可以使用:vncserver -kill :1
vncserver :1 -geometry 1280x800 -depth 24 -localhost no -rfbport 5901
其中5901
是你新设置的端口号。/usr/bin/vncserver
或/usr/local/bin/vncserver
。-rfbport
选项,并指定新的端口号。例如:/usr/bin/vncserver :1 -geometry 1280x800 -depth 24 -localhost no -rfbport 5901
sudo systemctl restart vncserver
通过以上步骤,你应该能够成功修改Ubuntu系统中TigerVNC的默认端口。