Pub-IP Server
# git clone https://github.com.cnpmjs.org/fatedier/frp
wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
tar -xzvf frp_0.37.0_linux_amd64.tar.gz
cd frp_0.37.0_linux_amd64/
rm -rf frps.ini
echo "# frps.ini
[common]
bind_port = 7000
" >> frps.ini
tmux
./frps -c ./frps.ini
Private Server
Install openssh-server
- add to /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
- Install
sudo apt-get update
sudo apt-get install openssh-server
Download frp:
wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
# or wget https://github.com.cnpmjs.org/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
tar -xzvf frp_0.37.0_linux_amd64.tar.gz
cd frp_0.37.0_linux_amd64/
Update config file:
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
Enable frpc.service
FRPPWD=YOUR_PATH
sudo echo "[Fusion]
Description=Frp Server Daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart=$FRPPWD/frpc -c $FRPPWD/frpc.ini
ExecStop=/usr/bin/killall frpc
RestartSec=1min
KillMode=control-group
Restart=always
[Install]
WantedBy=multi-user.target" >> /etc/systemd/frpc.service
sudo systemctl enable /etc/systemd/frpc.service
sudo systemctl start frpc.service
sudo systemctl status frpc.service
Usage
ssh -oPort=6000 ubuntu@xxxxx