Last active
August 30, 2021 12:58
-
-
Save nestoru/fee24a59804d60ccba1a to your computer and use it in GitHub Desktop.
Install XRDP in Ubuntu
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 -e | |
# | |
# ubuntu-install-xrdp.sh | |
# Tested in Ubuntu 20.04: Bidirectional clipboard does work. | |
# | |
# One line installer (change ubuntu by the username that you want to remotely login): | |
# curl -L https://gist.github.com/nestoru/fee24a59804d60ccba1a/raw | sudo bash -s ubuntu | |
# | |
START=$(date +%s) | |
if ! [ $(id -u) = 0 ]; then | |
echo "I will work only under root!" | |
exit 1 | |
fi | |
USAGE="Usage: `basename $0` <user>" | |
if [ $# -ne "1" ] | |
then | |
echo $USAGE | |
exit 1 | |
fi | |
user=$1 | |
if [ "$user" == "root" ]; then | |
user_home=/root | |
else | |
user_home=/home/$user | |
fi | |
apt-get update -y | |
apt-get install -y ubuntu-desktop | |
apt-get install -y xrdp | |
adduser xrdp ssl-cert | |
systemctl restart xrdp | |
echo Run the below commands if RDP is still not running to find out the cause: | |
echo " sudo systemctl status xrdp" | |
echo " tail -100 /var/log/xrdp-sesman.log" | |
END=$(date +%s) | |
DIFF=$(( $END - $START )) | |
echo "Finished in $DIFF seconds" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment