关于frp的一些脱坑总结,比如login to server failed: authorization failed

首先第一个,最恼火最困扰我的,就是token的写法:
网上的教程历史跨段比较长,而不同版本,在一些语句上的写法是不一样的,比方说:privilege_token在高版本frps里早改为token了
如果你看的教程,跟你现在用的版本不一致(截止我写这个文章的时候最新版本是0.27,而你看的教程则有可能是0.16版本),那么就活脱脱给自己挖坑了
我给一个授权错误(login to server failed: authorization failed)卡了很久,琢磨了很久,网上是众说纷纭
有说是时间差的,于是我查资料,加了authentication_timeout = 0,没有用
有说是端口没打开的,我开了7000端口,没有用
最后我较真到了“=”号前后到底要不要留空格,因为确实仔细看教程,有些教程等号前后有空格的,有的没有,官方自己的ini文件就是没有空格的。
最后不知道怎么运气了,我发现这个token的写法貌似有点不对劲,官方的写法就是token = 12345678,而我看的教程(也照做了)的写法是auth_token
这就完蛋了,难怪,真想打自己脸一下。
后边改回跟server一致的写法,都写成token = 12345678就应该ok了(当然后边12345678肯定得改成自己的小秘密)

第二个坑:
改完之后,s/c两端再次运行,又出现了新的拦路虎:
login to server failed: i/o deadline reached
于是我又得查资料,翻来覆去,找到一篇貌似靠谱的文章,说是MTU不一致导致的结果,解决方案是改mtu,天啦噜,要不要这么麻烦!
不死心,我再试试重复运行同样的命令,嗳,这次又好了,不改mtu也好了,至于刚才为毛出现错误,不管了,我又不是研究僧。

第三个坑:
有些教程里边,对于二级域名的写法是:
custom_domains = web
放在0.27版本里边,也是个天坑,正确的写法应该是
subdomain = web
然后你就可以用“web.你的域名”这样的拼写格式来远程访问你的路由器或者别的服务了。

附上我的frps.ini

[common]
bind_addr = 0.0.0.0
bind_port = 7000
bind_udp_port = 7001
kcp_bind_port = 7000
vhost_http_port = guess
vhost_https_port = 443
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = guess
dashboard_pwd = guess
log_file = ./frps.log
log_level = info
log_max_days = 3

token = guess
authentication_timeout = 0

allow_ports = 2000-3000,3001,3003,4000-50000

max_pool_count = 5

# max ports can be used for each client, default value is 0 means no limit
max_ports_per_client = 0

# if subdomain_host is not empty, you can set subdomain when type is http or https in frpc’s configure file
# when subdomain is test, the host used by routing is test.frps.com
subdomain_host = guess

# if tcp stream multiplexing is used, default is true
tcp_mux = true

还有frpc.ini写法

[common]
server_addr = guess
server_port = 7000
token = guess

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = guess

[web]
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = guess

[qb]
type = http
local_ip = guess
local_port = guess
subdomain = guess

点赞

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注