分享工作和学习中的点点滴滴,包括前端、后端、运维、产品等各个方面,欢迎您来关注订阅!
分类: LINUX
2021-04-18 01:57:26
公网服务器的配置照旧,注意防火墙或者宝塔之类的放行frps用的端口。可以参考之前的文章:
[common] bind_addr=0.0.0.0 bind_port = 7000 token=12310086 dashboard_port = 7500 dashboard_user = admin dashboard_pwd = admin123
./frps -c frps.ini
[common] server_addr = 服务端ip server_port = 7000 token=12310086 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 30022
ssh -p 30022 root@ip
服务器端配置如上。
[common] server_addr = 服务器ip server_port = 7000 token=12310086N [secret_ssh] type = stcp sk = 4u4rUif0vm9zn6dZ local_ip = 127.0.0.1 local_port = 22
frpc.exe -c frpc.ini
编辑 fcpc.ini文件,配置上"role = visitor"身份。
[common] server_addr = 服务器ip server_port = 7000 token=12310086N [secret_ssh_visitor] type = stcp role = visitor sk = 4u4rUif0vm9zn6dZ server_name = secret_ssh bind_addr = 127.0.0.1 bind_port = 30022
frpc.exe -c frpc.ini
然后使用ssh或者x之类的ssh软件,连接本地的30022端口
ssh root@127.0.0.1 -p 30022