基于Frp的内网穿透,校园网外ssh访问实验室服务器
Contents
Reference: Access your computer in a LAN network via SSH.
On server A (in the LAN):
-
set up
frpclient:1 2 3 4wget https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_amd64.tar.gz tar -zxvf frp_0.53.2_linux_amd64.tar.gz cd frp_0.53.2_linux_amd64 nano frpc.toml1 2 3 4 5 6 7 8 9 10# frpc.toml serverAddr = "43.139.224.203" # public IP serverPort = 7000 [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 1220 remotePort = 6000- Make
6000and7000accessible:sudo ufw allow 6000andsudo ufw allow 7000.
- Make
-
run
frpclient by1./frpc -c ./frpc.tomlor
1nohup ./frpc -c ./frpc.toml &If any conflicts:
1pkill -f frpc
On server B (with a public ip address):
-
set up
frpserver:1 2 3 4wget https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_amd64.tar.gz tar -zxvf frp_0.53.2_linux_amd64.tar.gz cd frp_0.53.2_linux_amd64 nano frps.toml1 2# frps.toml bindPort = 7000 -
run
frpserver by1./frps -c ./frps.tomlor
1nohup ./frps -c ./frps.toml &if any coflicts:
1pkill -f frps
On your computer oustide the LAN containing server B:
|
|