Skip to content

Instantly share code, notes, and snippets.

@Sarverott
Created September 9, 2023 10:23
Show Gist options
  • Save Sarverott/eb36567406f953ac4b371c49c42f81aa to your computer and use it in GitHub Desktop.
Save Sarverott/eb36567406f953ac4b371c49c42f81aa to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "RDP server prepare"
echo "exclusive access subnet IP address (or single IP, 127.0.0.1):"
read accessIp
echo "subnet mask length (32 if exclusive for only one host):"
read accessMask
echo "port (default is 3389):"
read accessPort
sudo apt install xrdp -y
sudo systemctl status xrdp
echo "\npress enter when ready..."
read x
echo "\n\n\n"
sudo systemctl start xrdp
sudo systemctl status xrdp
echo "\npress enter when ready..."
read x
echo "\n\n\n"
sudo nano /etc/xrdp/xrdp.ini
cd ~
echo "mate-session" | tee .xsession
sudo systemctl restart xrdp
sudo ufw allow from $accessIp/$accessMask to any port $accessPort
sudo apt install remmina
echo "\npress enter..."
read x
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment