Last active
July 25, 2024 01:03
-
-
Save djravine/88f2b9957a0bef6a6dd4c55aca951a09 to your computer and use it in GitHub Desktop.
Setup Local xRDP on Ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xuo pipefail | |
# GIST: https://gist.github.com/djravine/88f2b9957a0bef6a6dd4c55aca951a09 | |
# USAGE: curl -sL https://gist.github.com/djravine/88f2b9957a0bef6a6dd4c55aca951a09/raw | bash -s -- | |
# INSTALL SOFTWARE | |
sudo apt-get update | |
sudo apt-get install -y \ | |
ubuntu-desktop \ | |
xorg \ | |
xrdp \ | |
xorgxrdp \ | |
xorg-video-abi-23 \ | |
xserver-xorg-core \ | |
xserver-xorg-input-all \ | |
xfonts-base \ | |
xfonts-75dpi \ | |
xfonts-100dpi \ | |
mate-core \ | |
mate-desktop-environment \ | |
mate-notification-daemon \ | |
indicator-sound-gtk2 \ | |
indicator-application-gtk2 \ | |
ubuntu-gnome-desktop \ | |
gnome-session-flashback \ | |
gnome-panel \ | |
gnome-tweak-tool \ | |
xfce4 \ | |
xfce4-goodies | |
sudo apt-get autoremove -y | |
# AUTH POPUP | |
sudo bash -c 'cat > /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf' << EOF | |
polkit.addRule(function(action, subject) { | |
if ((action.id == "org.freedesktop.color-manager.create-device" || | |
action.id == "org.freedesktop.color-manager.create-profile" || | |
action.id == "org.freedesktop.color-manager.delete-device" || | |
action.id == "org.freedesktop.color-manager.delete-profile" || | |
action.id == "org.freedesktop.color-manager.modify-device" || | |
action.id == "org.freedesktop.color-manager.modify-profile") && | |
subject.isInGroup("{users}")) { | |
return polkit.Result.YES; | |
} | |
}); | |
EOF | |
# ALLOW FIREWALL | |
sudo ufw allow 3389/tcp | |
# SET SESSION MANGER | |
if [ -f /home/${USER}/.xsession ]; then | |
rm -f /home/${USER}/.xsession | |
fi | |
cat << 'EOF' >> /home/${USER}/.xsession | |
export LOGNAME=$USER | |
export LIBGL_ALWAYS_INDIRECT=1 | |
unset SESSION_MANAGER | |
unset DBUS_SESSION_BUS_ADDRESS | |
mate-session # Works | |
#gnome-session --session=gnome-flashback-metacity --disable-acceleration-check & gnome-panel # Works | |
#xfce4-session # Works | |
EOF | |
chmod +x /home/${USER}/.xsession | |
# RUN BASH NOT SH | |
sudo sed -i "s|#\!/bin/sh|#\!/bin/bash|g" /etc/X11/Xsession | |
# ADD XRDP USER TO SSL-CERT GROUP | |
sudo adduser xrdp ssl-cert | |
# XRDP - RESTART | |
sudo service xrdp restart | |
# XRDP - STATUS | |
sudo service xrdp status |
Is there an exact reversal procedure to the listed steps of the script, specifically for removing the added rules?
You could move the conf file that was created into a backup file so it doesn't get run
mv /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf.backup
worked perfectly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an exact reversal procedure to the listed steps of the script, specifically for removing the added rules?