I have set up a server at home, hosting a personal homepage, cloud storage, project management applications, and it runs smoothly. Moreover, all the data is stored locally, ensuring data security. These applications meet the needs of internet access well, and I use the open-source FRP for intranet penetration. I find it very comfortable to use and have shared my experience of building a server on the platform, which has received 8K reads, showing that it has gained recognition from everyone. I hope it can provide you with some reference and help.
1. Preparation Work
To build a home server, from hardware to software, I provide some references:
-
One cloud server ECS instance
Alibaba Cloud’s “Double 11” massive discounts are continuous, grab the “80% off coupon” and benefit from Alibaba!
Recommended: 2 cores, 2GB RAM, 40GB storage, 3M bandwidth, $99 per year, shared by new and old users, same price for renewal.
How to claim: Message in the backend, password [coupon]
-
Using a laptop that has been around for nearly 10 years, just a joke, you can use one that you are preparing to eliminate.
-
Install Linux system, choose the distribution based on personal preference, first-time Linux users can choose Ubuntu or Debian.
-
100M Telecom broadband
2. Installing the FRP Server
2.1 Download the FRP intranet penetration tool on the cloud server
Switch to the root user on the cloud server and download the FRP tar package from GitHub.
$ wget https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_amd64.tar.gz
2.2 Install the FRP tool
Find the frp_0.53.2_linux_amd64.tar.gz compressed package under /root and unzip it.
$ tar -zxvf frp_0.53.2_linux_amd64.tar.gz
2.3 Configure frps, allow port 7000 in the security group
By configuring frps.toml, bind the port to 7000, which is the port used for SSH access between the home server and the cloud server.
# Modify the configuration file using vim
$ vim ./frps.toml
# Bind port number
bindport=7000
2.3 Run frps in the background
Run frps in the background so that even if you exit SSH, the frps service remains online.
$ nohup ./frps -c ./frps.toml >/dev/null 2>&1 &
3. Installing the FRP Client
3.1 Locally install the FRP client
$ wget https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_amd64.tar.gz
Are you wondering why the FRP client and server are in one package? Don’t worry, just keep reading.
3.2 Install the FRP tool
$ tar -zxvf frp_0.53.2_linux_amd64.tar.gz
3.3 Configure frpc, allow port 6000 in the security group
# Modify the configuration file using vim
$ vim frpc.toml
# frpc.toml configuration content
serverAddress = "Cloud server public IP"
serverPort = 7000
[[proxies]]
name = "test-tcp"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000
Q&A Classroom!!!
Guys, now you can answer your previous doubts. This compressed package contains both the server and client, with different startup programs for the cloud server and the local host.
Take note!!!
Guys, remember to allow port 6000 in the security group configuration. This is the port that maps the local host to the cloud server and provides access to applications. SSH accesses the local server through this port number.
3.4 Start the FRP client
$ ./frpc -c ./frpc.toml
4. Remote Access to Local Server
4.1 Access the local server remotely via SSH
$ ssh -p 6000 username@cloud_server_public_IP
SSH remote server error.
Local server error.
Guys, are you experiencing issues at this point? SSH access was denied!
Here, I found that there is no correct solution for the SSH access denial in any articles I have seen regarding the FRP remote penetration tool for homemade servers. Let me fill this gap for you, it’s tested and effective, so feel free to use it!
Don’t ask for rewards, just a free like is encouragement for me to continue providing quality content.
4.2 Solutions for SSH remote connection denial
There could be several reasons for SSH access denial:
-
SSH is not installed
-
SSH daemon is not running
-
SSH login credentials are incorrect
-
Access port is closed
Through elimination, we found that the SSH daemon was not running. The problem was identified, and we can start the daemon using systemctl.
# Start SSH
$ systemctl start sshd
# Check the status of the SSH daemon
$ systemctl status sshd
Once again, log in to the server remotely, and the cloud server responds that remote access was successfully connected, while the local server shows that port 22 is connected.
The cloud server shows an established SSH connection.
The local server shows an established SSH connection.
At this moment, I just want to say: I confirmed the eye contact, and met the right person.
Alibaba Cloud server 20% off coupon, how to claim:
Message in the backend, password [coupon]