Article directory
This article mainly introduces how to install XRDP remote desktop on Ubuntu, realize remote desktop Ubuntu in the same LAN, and solve the problem of remote desktop login blue screen. And do intranet penetration, use cpolar intranet penetration to map port 3389, generate public network TCP port address, and realize remote desktop Ubuntu system in public network environment.
[cpolar intranet penetration supports http/https/tcp protocols, supports permanent free use, does not limit traffic, does not require a public network IP, and does not need to enter router settings. It is simple to operate. 】
1. Remote desktop Ubuntu within the same LAN
This tutorial is applicable to Ubuntu version:
- Ubuntu 20.04.x
- Ubuntu 22.04.x
- Ubuntu 23.04.x
- Ubuntu 23.10.x
Download xrdp script
wget https://www.c-nergy.be/downloads/xRDP/xrdp-installer-1.4.8.zip
Unzip files
unzip xrdp-installer-1.4.8.zip
Download the script to the native system, extract the contents and mark it as executable
chmod +x xrdp-installer-1.4.8.sh
Run service
./xrdp-installer-1.4.8.sh
View IP address
ifconfig
As shown in the figure: In this example, the Ubuntu host IP is 192.168.149.135
Note: Restart the Ubuntu host, do not log in to the account
2. Use Windows Remote Desktop Connection
On the LAN, find another Windows host, open Remote Desktop Connection, enter the IP address of the Ubuntu host, and click Connect.
Enter the IP address of the Ubuntu host, as well as the username and password.
Click OK
the button to connect remotely.
Now, the remote desktop connection is successful.
3. Public network environment system remote desktop Ubuntu
In an environment where there is no public IP, remote desktop connection can be achieved through cpolar intranet penetration and mapping port 3389.
1. Register a cpolar account and install it
cpolar official website address: https://www.cpolar.com
- Use one-click script installation command
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
- Add services to the system
sudo systemctl enable cpolar
- Start cpolar service
sudo systemctl start cpolar
After cpolar is successfully installed, access Linux port 9200 on an external browser: [http://LAN ip:9200], log in with your cpolar account (if you don’t have an account, you can click below to register for free), and you can see it after logging in cpolar web configuration interface, just configure it in the web management interface
2. Create a tunnel and map port 3389
After logging in to the cpolar web UI management interface, click Tunnel Management on the left - Create Tunnel to create a tcp tunnel.
- Tunnel name: xrdp (can be customized, be careful not to repeat)
- Protocol: tcp (supports http/https/tcp)
- Local address: 3389
- Port type: Random temporary TCP port
- Address: Select China Top
After the tunnel is successfully created, the Ubuntu host restarts without logging in.
Go to the Cpolar official website in Windows , log in to your account, click Status on the left , and find the name of the tunnel you just created.
Copy the port address behind tcp:// (for example 18.tcp.cpolar.top:14743)
3. Windows Remote Desktop Ubuntu
Open the remote desktop connection on the Windows computer, enter the generated public network TCP port address, and click连接
Click“是”
Enter the username and password of the Ubuntu system and click"OK"
The remote desktop login is successful and the Windows remote desktop is connected to the Ubuntu system in the public network environment.
It should be noted that the random temporary public network address generated by the free cpolar package is used in this article, which changes every 24 hours and has a small bandwidth.
Each time you log in, you need to re-create the tunnel and go to the cpolar official website to check the public network tunnel address. 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 network TCP ports. And the bandwidth will be increased accordingly, supporting more efficient and convenient remote desktop connection to Ubuntu system.
4. Configure remote Ubuntu with fixed public network address
1. Reserve a fixed TCP address
Log in to the cpolar official website backend , click Reserve on the left, and find the reserved TCP address:
- Region: Select China VIP
- Description: Notes, which can be customized
Click保留
The fixed TCP address is retained successfully. The system generates the corresponding public network address + fixed port number and copies them.
2. Configure a fixed TCP address
Visit http://127.0.0.1:9200/ with the browser to log in to the cpolar web UI management interface, click Tunnel Management - Tunnel List on the left dashboard, find the code tunnel you just created, and click Edit on the right
Modify the tunnel information and configure a fixed TCP port address:
- Port Type: Select Fixed TCP Port instead
- Reserved TCP address: Fill in the fixed TCP port address that was successfully reserved just now
Click更新
It prompts that the tunnel update is successful. Click the status on the left dashboard - Online Tunnel List. You can see that the public network address of the tunnel you just modified has been updated to a fixed TCP port address. Copy it.
Restart Ubuntu host without logging in
3. Remote Ubuntu using fixed TCP address
Paste the public network address you just copied into the Windows remote connection (enter tcp:// behind the tunnel address), click Connect
Continue to enter your Ubuntu username and password
Click Connect , the remote desktop login is successful, and the Windows remote desktop is connected to the Ubuntu system in the public network environment.