Linux远程桌面协议

Linux remote desktop protocols

Posted by Eric on October 10, 2022

简单说一下远程桌面相关的一些小细节, 毕竟工作做了这么久远程桌面, 真的要详细说的话, 几天都说不完.

1. RDP

服务端

1
 sudo apt install -y xserver-xorg xrdp xorg dbus-x11 x11-xserver-utils

debian允许root用户ssh登陆

1
2
3
/etc/ssh/sshd_config

PermitRootLogin yes

重启服务

1
/etc/init.d/ssh restart

指定rdp连接的桌面

xfce为例

1
2
3
echo xfce4-session > ~/.xsession 
以及在  vi /etc/X11/Xsession 
首行添加 xfce4-session

2. VNC

vnc几乎只适用于调试, 没有usb重定向, 画面质量也很低, 但是方便网页登陆.

1
2
3
sudo apt install tigervnc-standalone-server tigervnc-common -y

vncserver :1 -localhost no

在vnc配置想要启动的桌面

1
2
3
4
vim .vnc/xstartup

#!/bin/sh
gnome-session

iptables

1
2
iptables -I INPUT -p tcp --dport 3389 -j ACCEPT
echo 'iptables -I INPUT -p tcp --dport 3389 -j ACCEPT' >> /etc/profile

3. SPICE

编译报错xorg-macros 1.3

1
sudo apt-get install xutils-dev

x11spice位置

1
https://gitlab.freedesktop.org/spice/x11spice