Debian Stream 8 远程控制实用指南
说明与准备
sudo apt updatesudo apt install xfce4 xfce4-goodies(或 sudo apt install task-gnome-desktop)sudo ufw status(如使用 ufw)方案一 SSH 命令行远程(最稳妥)
sudo apt install openssh-serversudo systemctl start ssh && sudo systemctl enable sshsudo systemctl status sshsudo ufw allow ssh(或 sudo ufw allow 22/tcp)ssh username@服务器IP/etc/ssh/sshd_config 的 Port 2222,重启服务:sudo systemctl restart sshssh-keygen -t ed25519ssh-copy-id -p 2222 username@服务器IP/etc/ssh/sshd_config 设置:PermitRootLogin no、PasswordAuthentication no,重启服务方案二 XRDP 远程桌面(Windows 远程桌面体验)
sudo apt install xrdpsudo systemctl start xrdp && sudo systemctl enable xrdpsudo ufw allow 3389/tcp服务器IP:3389方案三 VNC 远程桌面(跨平台通用)
sudo apt install tigervnc-standalone-server tigervnc-commonvncpasswd(保存在 ~/.vnc/passwd)vncserver :1 -geometry 1366x768 -depth 24vncserver :1/etc/systemd/system/vncserver@:1.service,内容示例:[Unit]
Description=TigerVNC Server
After=syslog.target network.target
[Service]
Type=forking
User=你的用户名
Group=你的用户名
WorkingDirectory=/home/你的用户名
PIDFile=/home/你的用户名/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver :%i -geometry 1366x768 -depth 24
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reloadsudo systemctl enable --now vncserver@:1.servicesudo ufw allow 5901/tcp服务器IP:5901安全与排障要点
nc -vz 服务器IP 22、nc -vz 服务器IP 3389、nc -vz 服务器IP 5901sudo journalctl -u ssh、sudo journalctl -u xrdp、sudo journalctl -u vncserver@:1sudo apt install xfce4 后再连)。