Ubuntu下安裝
sudo apt install x11vnc -y
設置訪問密碼
sudo x11vnc -storepasswd /etc/x11vnc.pass
編輯配置文件
vim /lib/systemd/system/x11vnc.service
- 添加以下內容
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
配置防火牆
sudo ufw allow 5900
開機啟動服務
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
重啟系統后查看服務狀態
sudo systemctl status x11vnc.servic