QNAP NAS file sharing - build SFTP service and penetrate the intranet to achieve remote access outside

Reprinted from the article of remote intranet penetration: QNAP QNAP NAS builds SFTP service, and intranet penetration realizes remote access to the public network

foreword

This tutorial implements the establishment of SFTP service on QNAP QNAP NAS, and maps it to the public network through cpolar intranet penetration, so that the QNAP SFTP service connected to the home intranet can also be remotely accessed in the public network environment.

1. Enable SFTP on QNAP NAS

Enter the QNAP console and find Telnet/SSH

20230214172101

Check whether SSH and SFTP are enabled. If not, you need to enable them and click Apply

20230214172102

2. Test LAN access

After SSH and SFTP are started, we use the QNAP IP address to test whether the connection is normal. Here we use the FileZill tool for testing:

  • Host: Enter QNAP IP address
  • Username: QNAP username
  • Password: QNAP login password
  • port: 22

Click 快速连接, and the directory appears, which means the connection is successful

20230214172103

3. Intranet penetration

After there is no problem with the LAN test connection, then we will do intranet penetration, and map port 22 to the public network, so as to realize remote access to QNAP files at home on the external public network, and realize file sharing. Here we use cpolar intranet penetration to achieve it, no need for public network IP, no need to set up routers, and the operation is simple.

3.1 QNAP install cpolar intranet penetration

How to install cpolar on QNAP NAS, please refer to this article tutorial:

3.2 Create a tunnel

After successfully installing cpolar on the QNAP NAS, visit the QNAP IP address: 9200 on the browser, and log 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 Type: Select TCP
  • Local address: 22
  • Port type: currently selected randomly, it can be used for free, let's test it temporarily
  • Region: It can be selected by default, or select the China VIP region

click创建

20230214172104

After the tunnel is successfully created, we can see the public network address + public network port number generated by the tunnel we just created in the status of the dashboard on the left--the list of online tunnels, and copy it.

20230214172105

3.3 Test public network remote access

Open the FileZill tool, use the public network address you just obtained and copied sftp://3.tcp.vip.cpolar.cnto connect, pay attention to add sftp://, the port number needs to be replaced with the port 11630 of the public network address, and the list of directories indicates success

20230214172106

4. Configure a fixed public network TCP port address

Since we used a random address when creating the tunnel above, it is only suitable for testing, and the generated address will change randomly within 24 hours. For a better connection, we need to fix the TCP port address to make the connection more stable and increase the bandwidth.

It should be noted that to configure a fixed TCP port address, cpolar needs to be upgraded to a professional package or above.

20230214172107

4.1 Reserve a fixed TCP port address

Log in to the cpolar official website www.cpolar.com , enter the background of the official website, click on the reservation on the left, and then find the reserved TCP address

  • Region: Select China VIP
  • Description: Remarks, which can be customized

click保留

20230214172108

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

20230214172109

4.2 Configure fixed TCP port address

Access and log in QNAP's cpolar web UI management interface on the browser, ie 威联通IP:9200. Click Tunnel Management on the left dashboard - Tunnel List, find the previously created QNAP SFTP tunnel, and click Edit on the right

20230214172110

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 successfully reserved address

click更新

20230214172111

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

20230214172112

4.3 Test using a fixed TCP port address to remotely connect to QNAP SFTP

Open FileZill, replace the host address and port number with the fixed tcp address and port number that have just been successfully configured, and then click Connect

20230214172113

Guess you like

Origin blog.csdn.net/Qingai521/article/details/131596293
Recommended