Ubuntu 22.04 SSH与远程桌面配置
SSH配置
直接在终端执行下列指令即可:
sudo apt update
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
sudo systemctl status ssh
sudo ufw allow sshopenssh-server有时可以直接被替换为ssh。
SSH服务默认使用22端口。
远程桌面(RDP)配置
Ubuntu的默认配置
Ubuntu 22.04 LTS的Gnome桌面自带了远程桌面和VNC选项。从 [设置] > [共享] > [远程桌面] 即可启用RDP和VNC远程访问。
请注意:使用RDP时推荐将Ubuntu自动关闭显示器的时间设为“从不”,您可以在 [设置] > [电源] 中找到该选项。同时Ubuntu的RDP无法像Windows那样自动适应您的客户机的分辨率,因此您可能会希望购买一个“显卡欺骗器”来制作一个假的、具有较高的可调整分辨率范围的“显示器”。
使用XRDP
您也可以不使用Ubuntu自带的远程桌面,而使用XRDP:
sudo apt update
sudo apt install xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp
sudo systemctl status xrdp
sudo ufw allow 3389RDP服务默认使用3389端口。
有关XRDP潜在的重连黑屏问题,请参考AlmaLinux 9上使用XRDP登录后黑屏。
参考资料
https://zhuanlan.zhihu.com/p/145763789
页面版本: 2, 最后编辑于: 04 Jul 2026 10:30





