Ubuntu18.04安装xrdp 桌面远程服务

做~自己de王妃 提交于 2021-01-09 09:53:55

终端改目录改英文
export LANG=en_US
xdg-user-dirs-gtk-update
export LANG=zh_CN.UTF-8
xdg-user-dirs-gtk-update

=================================================
xrdp是原生方案,兼容性是最好的,也不需要太多额外的软件支持。
sudo apt install xrdp
sudo systemctl enable xrdp

第49行,new_cursors=true改为false
sudo sed -e 's/^new_cursors=true/new_cursors=false/g' \
           -i /etc/xrdp/xrdp.ini

sudo systemctl restart xrdp
         
创建 ~/.xsessionrc
vi ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
----------------------------------------------------------------------------
$ D=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
$ cat <<EOF > ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=${D}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF

---------------------------
sudo vi /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla

[Netowrkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes

sudo systemctl restart polkit
-------------------------------
$ cat <<EOF | \
  sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
[Netowrkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF

-------------------------------------------

sudo ufw enable
sudo ufw allow 22/tcp
sudo ufw allow 3389/tcp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!