Remote Access to ubuntu server - using RDP

  • STEPS

    1. Install xrdp on Ubuntu

    
                    sudo apt update
    
                    sudo apt install xrdp -y
                    
    Check the status
    
                    sudo systemctl status xrdp
                  

    2. Install Desktop Environment (UI)

    
                    sudo apt install xfce4
              

    3. Configure xrdp Port (Optional)

    Use a text editor, like nano, to edit the xrdp configuration file, xrdp.ini:
    
                  sudo nano /etc/xrdp/xrdp.ini
                  
    Locate the port directive in the [Globals] section and set the desired value. In this example, the RDP port is 49952:
    
                  port=49952
    

    Press Ctrl+X, followed by y, and then Enter to save the changes and exit the file. Restart the xrdp server to apply the changes:
    
    sudo systemctl restart xrdp
    

    4. Open a Port for Incoming Traffic in ufw

    Check the status of the ufw firewall:
    
    sudo ufw status
    
    If the firewall is inactive, use the following command to turn on ufw:
    
    sudo ufw enable
    
    Allow traffic on port 3389 or choose a different port for your RDP connection. The following command allows RDP connections on port 49952:
    
    sudo ufw allow 49952/tcp
    
    Reload the ufw firewall tool to apply the changes:
    
    sudo ufw reload
    

    5. Enable session

    
    sudo nano /etc/xrdp/startwm.sh
    
    add at the end of the above file
    
    export GNOME_SHELL_SESSION_MODE=ubuntu
    export XDG_CURRENT_DESKTOP=ubuntu:GNOME
    
    restart the machine
    
    reboot
    
    OR
    
    sudo shutdown -r now
    
    

    5. Configure Remote Desktop Connection on Windows

  • Install Firefox Browser
    
                  sudo apt-get purge firefox
    
                  sudo apt-get install firefox
    
                  xdg-settings get default-web-browser