[Linux] cpolar+JuiceSSH realizes the remote connection of the mobile phone to the Linux server

How can a virtual machine on the internal network be accessed from the external network? How can a mobile phone access the virtual machine?

cpolar+JuiceSSH realizes the remote connection of the mobile terminal to the Linux virtual machine (intranet penetration, the mobile terminal connects to the Linux virtual machine)

1. Linux install cpolar

First, we install the cpolar intranet penetration tool in Linux

cpolar official website address: https://www.cpolar.com

  • Use a one-click script to install commands. This script is applicable to Ubuntu16.04/18.04/20.04 and later, Centos7/8 and later versions, the latest official image of Raspberry Pi, and the new Linux operating system that supports systemd. This script will automatically determine the CPU architecture (i386/amd64/mips/arm/arm64, etc.), automatically download the corresponding cpolar client, and automatically deploy and install it.
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
  • Add a service to the system
sudo systemctl enable cpolar
  • Start the cpolar service
sudo systemctl start cpolar

After successfully starting the cpolar service, use the port on our browser Linux局域网IP地址:9200to access and log in to the cpolar web UI management interface (if you can’t access it, turn off the firewall), if you don’t have an account, click Register for free to create an account.

2. Create a public network SSH connection address

After logging in to the cpolar web UI management interface, click Tunnel Management on the left dashboard - Create Tunnel:

  • Tunnel name: can be customized, be careful not to duplicate the existing tunnel name
  • protocol: tcp
  • Local address: 22
  • Domain name type: temporary random TCP port
  • Region: Select China VIP

click创建

Then open the online tunnel list on the left, and check the public network address of the tcp connection generated after the tunnel was just created. This public network address is the address we need to use to connect

3. JuiceSSH public network remote connection

On the mobile phone, we download JuiceSSH, the software, the download software can be searched and downloaded on the Internet, after downloading and opening the software, we can see the quick connection, click on the quick connection

After clicking, enter the cpolar public network address we created above. Note that when inputting, follow the 用户名@cpolar地址format: input, and click OK after inputting

![]
After clicking OK, it prompts that we need to enter the password corresponding to the user name, and then click OK

After adding it, we successfully connected to our Linux server. Here we take the Ubuntu system as an example, so that the address for accessing the Linux server through remote ssh from the mobile phone is set up.

4. Fixed connection SSH public network address

It should be noted that the above steps use a random temporary tcp port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. Next, we configure a fixed TCP port address for it, which will not change, and there is no need to modify the address repeatedly every day after setting.

To configure a fixed tcp port address, you need to upgrade cpolar to a professional package or above.

Reserve a fixed tcp address

Log in to the cpolar official website , click on the reservation on the left, find the reserved tcp address, let's reserve a fixed tcp address for Minecraft:

  • Region: Select China VIP
  • Description: It is a note, which can be customized

click保留

After the address is successfully reserved, the system will generate a corresponding fixed public network address and copy it down

Open the cpolar web ui management interface, click on the tunnel management on the left dashboard - tunnel list, find the TCP tunnel we created above, and click on the right编辑

Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel

  • Port type: modified to fixed tcp port
  • Reserved tcp address: fill in the address successfully reserved on the official website,

click更新

After the tunnel is successfully updated, click the status on the left dashboard - the list of online tunnels, and you can see that the public network address has been updated to a fixed tcp address.

5. SSH fixed address connection test

After fixing the address, we open JuiceSSH, use our fixed address to connect, and when inputting, follow the 用户名@cpolar地址format: input, and click OK after inputting

It can be seen that the connection is successful, and a fixed and unchanged remote access address is set. Even if we connect next time, the address will not change

Guess you like

Origin blog.csdn.net/w2915w/article/details/132416917