Achieve Windows remote desktop Ubuntu 18.04 connection in a public network environment without public network IP, and achieve efficient remote working!


insert image description here

This article mainly introduces the installation of XRDP remote desktop on Ubuntu, realizes remote desktop Ubuntu in the same LAN, and solves 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 public network IP, and does not need to enter router settings, and is easy to operate.

1. Remote desktop Ubuntu within the same LAN

1. Update software repository

sudo apt update
sudo apt upgrade

2. Install support package

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. Install XFCE4 desktop environment

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

4. Install XRDP

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

5. Environment 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, join the XFCE session
echo xfce4-session > ~/.xsession

6 Restart the service

sudo systemctl restart xrdp

7. View IP address

sudo apt install net-tools
ifconfig

As shown in the picture:

In this example, the Ubuntu host IP is obtained as 192.168.9.144

insert image description here

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.

When logging in for the first time, it will display

insert image description here

Click the Use default config button to continue.

Now, the remote desktop connection is successful.

2. 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

1.1. Install cpolar (via one-click automatic 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 Add services to the system
sudo systemctl enable cpolar
1.3 Start cpolar service
sudo systemctl start cpolar

2. Log in to the cpolar web UI management interface

Access 127.0.0.1:9200 in the browser and log in using the cpolar account and password.

insert image description here

3. 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: Free users choose a random temporary TCP port, and professional package users can configure a fixed TCP port
  • Address: Select China

insert image description here

After the tunnel is successfully created, click the status on the left dashboard - online tunnel list, check the public network TCP port address generated by the xrdp tunnel, and copy it.
[In this example, it is http://1.tcp.cpolar.cn:23975]

insert image description here

4. Remote Desktop Ubuntu

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

insert image description here

Click“是”

insert image description here

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

insert image description here

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

insert image description here


It should be noted that the random temporary public network address generated by the free cpolar package is used in this article, which will change every 24 hours, and the bandwidth is small.

For users who have 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 increase accordingly, supporting more efficient and convenient remote desktop connection to the Ubuntu system.

Reprinted from cpolar pole cloud article: [No public network IP] Windows Remote Desktop Ubuntu 18.04 in a public network environment

Guess you like

Origin blog.csdn.net/weixin_74937672/article/details/132737492