Application of intranet penetration-Ubuntu installs XRDP remote desktop combined with intranet penetration to realize remote desktop Ubuntu

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

image-20231220175217176

Note: Restart the Ubuntu host, do not log in to the account

dd3d96700087f8ed6315145dd5fa6f0

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.

image-20231220175425020

Enter the IP address of the Ubuntu host, as well as the username and password.

image-20231220175613079

Click OKthe button to connect remotely.

71f340abf88aba0e9fdb75760bb6bf2

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

Insert image description here

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

Insert image description here

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)

image-20231221155827640

3. Windows Remote Desktop Ubuntu

Open the remote desktop connection on the Windows computer, enter the generated public network TCP port address, and click连接

image-20231221160046808

Click“是”

Insert image description here

Enter the username and password of the Ubuntu system and click"OK"

9a68d33d9f54f815c25d73a48f2c8a8

The remote desktop login is successful and the Windows remote desktop is connected to the Ubuntu system in the public network environment.

800e856e82076cd3e224fb649792d27

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保留

image-20231221161029155

The fixed TCP address is retained successfully. The system generates the corresponding public network address + fixed port number and copies them.

image-20231221161155216

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

a5e2f4a290d2080a6576c4d7bed9163

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更新

image-20231221161429846

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.

image-20231221161537281

Restart Ubuntu host without logging in

image-20231221162011738

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

image-20231221161737119

Continue to enter your Ubuntu username and password

image-20231221162243378

Click Connect , the remote desktop login is successful, and the Windows remote desktop is connected to the Ubuntu system in the public network environment.

d1836b0d91e0629b2c468e90cb0c423

Guess you like

Origin blog.csdn.net/weixin_42878111/article/details/135202856