[Network] penetrate hard disk hard disk external network environment to achieve remote management (to mount the router, for example) by FRP

Prior to penetrate through the column within the network, by penetrating servers, computers, routers, network penetration has introduced the principle and relevant practical applications, today to answer more questions backstage fans, how to achieve off-site remote access to home (company) the removable hard disk.

Need material prepared in advance:
  1. Taiwan public network server
  2. A hard disk
  3. A network server (raspberry pie, year-round boot computers, routers, etc.)

The basic idea: To remotely access the hard disk, at first, including network environment needs to have a "server" needs to mount remote access to the hard disk, so penetrate through the network within the network server, SFTP access the hard disk in the form of, in turn, may try to map a network hard disk drive, to achieve the above requirements.

Including the choice of network servers, need to find a perennial able to stay on the line to protect remote access to the machine's success rate, I home-based network topology, the router will AC88U ASUS introduces an example.

First, the basic configuration

(1) mount the hard drive to the network server (router)

Mount way home computers do not have to say, on the way to mount raspberry pie, router, see the article are:

  1. Raspberry Pi: " From zero to build a DAS server, mount the hard drive expansion, file storage and automatic download "
  2. Router: direct manual plug usb port (hard disk format recommended EXT4 file system, you can change the type of file system mount the disk using "Partition Assistant" formatting mode)
(2) open sftp service

1. First, open ssh, landing router shell.

Here Insert Picture Description
2. Next, install the necessary environment.

Since Merlin is based Entware to install the plug-in, so you need to install entware environment.

Merlin firmware can automatically recognize the file system and mount insert the disk in the time, but taking into account that some firmware may not perfect, it gives method to manually mount, for reference.

# 挂载
mkdir /mnt/sda1
mount -t ext4 /dev/sda1 /mnt/sda1/

# 检查
df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/sda1               916.9G      2.0G    868.4G   0% /tmp/mnt/sda1
#安装entware环境
entware-setup.sh

Here Insert Picture Description
Here Insert Picture Description
After a successful installation entware environment we can see opkg be configured.

3. Again, open SFTP.

opkg install openssh-sftp-server

Here Insert Picture Description

If unused for too long opkg command, may be error: "Failed to download openssh-sftp-server" using 'opkg update' updates.

4. Finally, within the network SFTP landing attempt.

WinSCP can be selected SFTP connection, access the directory: (tmp /) mnt / sda1, detected within the network environment is able to manage the contents of the hard disk.

Here Insert Picture Description

Second, the internal network through a router SSH (SFTP)

Frps penetration method in accordance with the article " under extranet environments Frp within the network through the router for remote access background " operation can be.

#路由器frpc配置文件
[common]
server_addr = 公网ip地址
server_port = 7000
token = 123456
log_file = /dev/null
log_level = info
log_max_days = 1
tcp_mux = true
protocol = tcp
login_fail_exit = false
user = admin

[AC88U-ssh]
type = tcp
local_ip = 路由器网关
local_port = 22
remote_port = 6100
use_encryption = true
use_compression = true

Open service penetration test whether the ability to remotely access and manage sftp mounted hard disk.

./frps -c ./frps.ini

#后台保持启动
nohup ./frps -c ./frps.ini &

Here Insert Picture Description
Here Insert Picture Description

Third, the Advanced: mapped as a network drive

Each time you select landing SFTP file management habits is not inevitable, whereby we can try to map a network hard disk drive, here we use SftpDrive implement the mapping. Click here to download SftpDrive

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
So far, the network penetration achieved by remote hard disk under management outside the network environment, if you have any questions or good suggestions, comments and look forward to your comments! Your point of praise and attention, is my greatest encouragement and support.

Published 75 original articles · won praise 505 · views 680 000 +

Guess you like

Origin blog.csdn.net/deng_xj/article/details/104190679