Created
August 15, 2023 07:27
-
-
Save Udara-Dananjaya/32b93517d2d75b51170f7a53fedc0207 to your computer and use it in GitHub Desktop.
Install Ubuntu Gnome RDP: Configure swap, SSH, user access, and Chrome Remote Desktop for remote connections with Gnome environment.
This file contains hidden or 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
# Install Ubuntu Gnome RDP Connection | |
# Gain superuser privileges | |
sudo -i | |
# Create swap area for managing memory | |
sudo dd if=/dev/zero bs=1M count=5024 of=/mnt/swapfile.swap | |
sudo chmod 600 /mnt/swapfile.swap | |
sudo mkswap /mnt/swapfile.swap | |
sudo swapon /mnt/swapfile.swap | |
echo '/mnt/swapfile.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab | |
# Check available RAM and disk space | |
free -m | |
df -h | |
# Update the list of available software packages | |
sudo apt update -y | |
# Upgrade installed packages to their latest versions | |
sudo apt-get upgrade -y | |
# Setup user account with SSH access on Ubuntu | |
sudo -s | |
adduser username | |
sudo usermod -aG sudo username | |
sudo ufw app list | |
sudo ufw allow OpenSSH | |
sudo ufw enable # Confirm with 'y' | |
sudo ufw status | |
sudo nano /etc/ssh/sshd_config # Open SSH configuration file | |
# Set 'PasswordAuthentication' to 'yes' | |
# PasswordAuthentication yes | |
sudo ufw reload | |
sudo service ssh restart | |
sudo ssh username@your_server_ip | |
# Set and unset user passwords | |
sudo passwd ubuntu | |
sudo passwd -d ubuntu | |
# Install Chrome Remote Desktop on a Headless Ubuntu | |
sudo apt update | |
sudo apt-get install -y wget | |
sudo wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb | |
sudo dpkg --install chrome-remote-desktop_current_amd64.deb | |
sudo apt install -y --fix-broken | |
sudo DEBIAN_FRONTEND=noninteractive apt install -y install gnome-session gnome-shell google-chrome-stable | |
sudo bash -c 'echo "exec /usr/bin/gnome-session" > /home/"$USER"/.chrome-remote-desktop-session' | |
sudo apt install -y xscreensaver | |
sudo groupadd chrome-remote-desktop | |
sudo usermod -a -G chrome-remote-desktop $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment