以下是在Ubuntu上加密VNC数据传输的常用方法:
sudo apt update && sudo apt install tightvncserver
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vnc.key -out /etc/ssl/certs/vnc.crt
~/.vnc/xstartup,添加以下内容:#!/bin/sh
exec /usr/bin/tightvncserver -geometry 1920x1080 -depth 24 -localhost no -rfbauth /home/yourusername/.vnc/passwd -rfbport 5900 -ssl -cert /etc/ssl/certs/vnc.crt -key /etc/ssl/private/vnc.key
赋予执行权限:chmod +x ~/.vnc/xstartup。vncserver :1
客户端连接时输入vnc://服务器IP:5900,选择SSL选项。sudo apt update && sudo apt install tigervnc-standalone-server
ssh -L 5901:localhost:5901 your_username@服务器IP
vncserver :1
localhost:1,启用客户端加密选项。vncpasswd设置强密码,并定期更换。以上方法可有效加密VNC数据传输,防止中间人攻击。