SSH 僅提供字元介面,若需完整 Linux 圖形桌面,TigerVNC 是開源、高效能的跨平台解決方案。本文示範 Windows 客戶端安裝與 Linux 伺服器端設定全流程。
tigervnc-.exe 。D:\Program Files\TigerVNC),完成安裝。# 安裝套件 yum install -y tigervnc tigervnc-server # 設定 VNC 密碼(執行使用者身分) vncserver # 輸入兩次密碼,系統會建立 ~/.vnc/passwd # 編輯服務設定 vim /etc/sysconfig/vncservers # 取消最後兩行註解並修改: VNCSERVERS="1:root" VNCSERVERARGS[1]="-geometry 1024x768 -depth 24" # 重啟服務 service vncserver restart # 開放防火牆埠口(預設 5901) iptables -A INPUT -p tcp --dport 5901 -j ACCEPT # 或關閉 SELinux:setenforce 0 / 永久修改 /etc/selinux/config
vncviewer.exe。伺服器IP:1(顯示編號對應 5900+編號)。~/.vnc/xstartup 是否正確啟動桌面環境(如 startkde &、gnome-session &)。vncserver 服務狀態。VNCSERVERARGS 中的 -geometry 參數。ssh -L 5901:localhost:5901 user@server),避免直接暴露 5901 埠。