Requirements and Configuration
- A jump server A with a public IP address: $a.a.a.a$
- An internal network machine B that needs penetration, with username: $bb$
Reference: Installation | frp (gofrp.org)
Download
You can download the latest versions of the client and server binaries from the GitHub Release page. All files are packaged in a compressed archive, which also includes a complete configuration parameter documentation.
Deployment
Extract the downloaded archive.
Copy $frpc$ to the internal network machine B.
Copy $frps$ to the public IP machine A, and place them in any directory.
Configuration
- Deploy $frps$ on the public IP machine A
Deploy $frps$ and edit the $frps.toml$ file. Here is a simplified configuration that sets the port for the frp server to receive client connections:
|
|
- Deploy $frpc$ on the internal network machine B
Deploy $frpc$ and edit the $frpc.toml$ file. Assuming the public IP address of the frps server is $a.a.a.a$, here is an example configuration:
|
|
localIP
andlocalPort
are configured as the address and port of the internal network service that needs to be accessed from the public network.remotePort
specifies the port to listen on the frp server. Traffic to this port will be forwarded to the corresponding port of the local service.
Startup
Direct Startup
- On machine A, start the server with the following command:
1
./frps -c ./frps.toml
- On machine B, start the client with the following command:
1
./frpc -c ./frpc.toml
System Startup
On Linux systems, you can use systemd
to conveniently manage the startup, shutdown, background operation, and automatic startup on boot of the $frps$ server. The same applies to the $frpc$ service.
Here are the detailed steps:
- Install systemd
If your Linux server does not have systemd installed, you can use package managers like yum
(for CentOS/RHEL) or apt
(for Debian/Ubuntu) to install it:
|
|
- Create the $frps.service$ file
Use a text editor (e.g., vim) to create a $frps.service$ file in the /etc/systemd/system
directory to configure the $frps$ service.
|
|
Write the following content:
|
|
- Manage the $frps$ service using systemd commands
|
|
- Enable $frps$ to start on boot
|
|
Usage
SSH Access
|
|
frp forwards traffic from $a.a.a.a:6000$ to port $22$ of the internal network machine.
VSCode Access
|
|
Troubleshooting
SSH connection error: REMOTE HOST IDENTIFICATION HAS CHANGED - CSDN Blog
SSH Login Warning: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! - Xinghen1216 - Blog Garden