Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office!

Time:2024-6-18
This article mainly introduces installing XRDP Remote Desktop on Ubuntu, realizing remote desktop Ubuntu on the same LAN, and also solving the problem of remote desktop login blue screen. dointranet penetration, using cpolar intranet penetration mapping port 3389 to generate a public TCP port address, realizing that in a public network environment, theRemote Desktop Ubuntu System
[cpolar intranet penetration support http/https/tcp protocols, support for permanent free use, unlimited traffic, no need for public IP, and do not need to enter the router settings, simple operation.]

I. Remote Desktop Ubuntu on the same LAN

1. Updating the software repository

sudo apt update
sudo apt upgrade

2. Installation of support packages

Install support Packages: Xorg, Xrdp, Xserver, Xfce4 and Mate Packages
sudo apt-get install xorg
sudo apt-get install xserver-xorg-core
sudo apt-get install xorgxrdp

3. Installation of the XFCE4 desktop environment

sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

4. Installation of XRDP

sudo apt install xrdp
sudo systemctl status xrdp
sudo systemctl restart xrdp

5. Environmental settings

5.1 XFCE Desktop Configuration
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh
5.2 In the configuration file, add the XFCE session
echo xfce4-session > ~/.xsession

6 Restarting services

sudo systemctl restart xrdp

7. Viewing IP addresses

sudo apt install net-tools
ifconfig
As pictured: In this example, get the Ubuntu host IP as 192.168.9.144 Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office!

8. Using Windows Remote Desktop Connection

On the LAN, find another Windows host, open a Remote Desktop Connection, and enter the IP address of the Ubuntu host, as well as the username and password. The first time you log in, it displays Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office! Click the Use default config button to continue. Now, there is a successful remote desktop connection.

Second, the public network environment system remote desktop Ubuntu

To realize remote desktop connection in an environment without a public IP, you can use cpolar intranet penetration to map port 3389.

1. Register a cpolar account and install

1.1 Installation of cpolar (by means of a one-click automated installation script)
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
or cpolar short link installation method: (for foreign use)
curl -sL https://git.io/cpolar | sudo bash
1.2 Adding services to the system
sudo systemctl enable cpolar
1.3 Starting the cpolar service
sudo systemctl start cpolar

2. Log in to the cpolar web UI management interface

Visit 127.0.0.1:9200 in your browser and log in using the cpolar account password Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office!

3. Create tunnel, map port 3389

After logging into the cpolar web UI management interface, click Tunnel Management – Create Tunnel on the left side to create a tcp tunnel.
  • Tunnel name: xrdp (customizable, take care not to repeat)
  • Protocol: tcp (supports http/https/tcp)
  • Local address: 3389
  • Port type: Free users choose random temporary TCP ports, Pro package users can – configure fixed TCP ports
  • Address: Select China
Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office! After the tunnel is successfully created, click Status – Online Tunnel List on the left dashboard to view the generated public TCP port address of the xrdp tunnel and copy it down. [In this case, http 23975] Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office!

4. Remote Desktop Ubuntu

Windows computers open a remote desktop connection, enter the generated public network tcp port address, and click thegrout Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office! strike (on the keyboard)"Yes." Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office! Enter the username and password for your Ubuntu system and click the"OK" Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office! Remote Desktop Login Successfully, Realize Windows Remote Desktop Connection to Ubuntu System in Public Network Environment Realize Windows Remote Desktop Ubuntu 18.04 connection in public network environment without public IP, efficient remote office!
Note that in this article we are using random temporary public addresses generated by the free cpolar package, which change every 24 hours and have a small bandwidth. For users with long-term remote desktop needs, it is recommended to upgrade the cpolar package to the professional package, which supports the configuration of fixed public TCP ports and the bandwidth will be increased accordingly to support more efficient and convenient remote desktop connection to Ubuntu systems.