[GH-ISSUE #4559] token in login doesn't match token from configuration #3606

Closed
opened 2026-05-05 14:18:53 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @AiENG07 on GitHub (Nov 26, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4559

Bug Description

frps 和frpc两边token设置一样,但是报错token in login doesn't match token from configuration
如果不设置token就能正常连接

frpc Version

0.61.0

frps Version

0.61.0

System Architecture

Linux hcss-ecs-19b9 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Configurations

frps.toml

# 服务端与客户端通信端口及密钥
bindAddr = "159.138.133.xx"
bindPort = 7000
auth.method = "token"
# 身份验证令牌 
auth.token = "12345678"

# 后台管理
webServer.addr = "159.138.133.xx"
webServer.port = 7001
webServer.user = "admin"
webServer.password = "admin"

#日志
log.to = "/root/app/frp/frps.log"
log.level = "info"
log.maxDays = 3

# 启用TCP多路复用
transport.tcpMux = true

# 允许的端口范围
allowPorts = [
  { start = 7000, end = 8000 }
]

# 每个客户端可以创建的最大连接池大小
transport.maxPoolCount = 50

#subDomainHost = "frps.com"

frpc.toml

serverAddr = "159.138.133.xx"
serverPort = 7000
auth.method = "token"
# 身份验证令牌
auth.token = "12345678"

[[proxies]]
name = "lx-kali-ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 7006
transport.useEncryption = true #frpc  frps 之间的通信内容加密传输
transport.useCompression = true #对传输内容进行压缩可以有效减小 frpc  frps 之间的网络流量


Logs

frps

[root@hcss-ecs-19b9 frp]# ./frps 
2024-11-26 21:22:24.145 [I] [frps/root.go:107] frps uses command line arguments for config
2024-11-26 21:22:24.346 [I] [server/service.go:237] frps tcp listen on 0.0.0.0:7000
2024-11-26 21:22:24.346 [I] [frps/root.go:114] frps started successfully
2024-11-26 21:22:31.064 [I] [server/service.go:576] [47d963b958b7acb8] client login info: ip [117.139.225.211:12094] version [0.61.0] hostname [] os [linux] arch [amd64]
2024-11-26 21:22:31.064 [W] [server/service.go:446] register control error: token in login doesn't match token from configuration

frpc

┌──(root㉿kali)-[~/app/frp]
└─# ./frpc -c frpc.toml
2024-11-26 08:22:30.926 [I] [sub/root.go:142] start frpc service for config file [frpc.toml]
2024-11-26 08:22:30.927 [I] [client/service.go:295] try to connect to server...
2024-11-26 08:22:31.225 [E] [client/service.go:280] token in login doesn't match token from configuration
2024-11-26 08:22:31.225 [W] [client/service.go:298] connect to server error: token in login doesn't match token from configuration
2024-11-26 08:22:31.225 [I] [sub/root.go:160] frpc service for config file [frpc.toml] stopped
login to the server failed: token in login doesn't match token from configuration. With loginFailExit enabled, no additional retries will be attempted

Steps to reproduce

  1. 配置frps和frpc的toml文件
  2. 运行frps服务器
  3. 运行frpc客户端

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @AiENG07 on GitHub (Nov 26, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4559 ### Bug Description frps 和frpc两边token设置一样,但是报错token in login doesn't match token from configuration 如果不设置token就能正常连接 ### frpc Version 0.61.0 ### frps Version 0.61.0 ### System Architecture Linux hcss-ecs-19b9 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ### Configurations frps.toml ```js # 服务端与客户端通信端口及密钥 bindAddr = "159.138.133.xx" bindPort = 7000 auth.method = "token" # 身份验证令牌 auth.token = "12345678" # 后台管理 webServer.addr = "159.138.133.xx" webServer.port = 7001 webServer.user = "admin" webServer.password = "admin" #日志 log.to = "/root/app/frp/frps.log" log.level = "info" log.maxDays = 3 # 启用TCP多路复用 transport.tcpMux = true # 允许的端口范围 allowPorts = [ { start = 7000, end = 8000 } ] # 每个客户端可以创建的最大连接池大小 transport.maxPoolCount = 50 #subDomainHost = "frps.com" ``` frpc.toml ```js serverAddr = "159.138.133.xx" serverPort = 7000 auth.method = "token" # 身份验证令牌 auth.token = "12345678" [[proxies]] name = "lx-kali-ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 7006 transport.useEncryption = true #frpc 与 frps 之间的通信内容加密传输 transport.useCompression = true #对传输内容进行压缩,可以有效减小 frpc 与 frps 之间的网络流量 ``` ### Logs # frps ```shell [root@hcss-ecs-19b9 frp]# ./frps 2024-11-26 21:22:24.145 [I] [frps/root.go:107] frps uses command line arguments for config 2024-11-26 21:22:24.346 [I] [server/service.go:237] frps tcp listen on 0.0.0.0:7000 2024-11-26 21:22:24.346 [I] [frps/root.go:114] frps started successfully 2024-11-26 21:22:31.064 [I] [server/service.go:576] [47d963b958b7acb8] client login info: ip [117.139.225.211:12094] version [0.61.0] hostname [] os [linux] arch [amd64] 2024-11-26 21:22:31.064 [W] [server/service.go:446] register control error: token in login doesn't match token from configuration ``` # frpc ```shell ┌──(root㉿kali)-[~/app/frp] └─# ./frpc -c frpc.toml 2024-11-26 08:22:30.926 [I] [sub/root.go:142] start frpc service for config file [frpc.toml] 2024-11-26 08:22:30.927 [I] [client/service.go:295] try to connect to server... 2024-11-26 08:22:31.225 [E] [client/service.go:280] token in login doesn't match token from configuration 2024-11-26 08:22:31.225 [W] [client/service.go:298] connect to server error: token in login doesn't match token from configuration 2024-11-26 08:22:31.225 [I] [sub/root.go:160] frpc service for config file [frpc.toml] stopped login to the server failed: token in login doesn't match token from configuration. With loginFailExit enabled, no additional retries will be attempted ``` ### Steps to reproduce 1. 配置frps和frpc的toml文件 2. 运行frps服务器 3. 运行frpc客户端 ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Nov 27, 2024):

Based on the description of the issue, the possible causes of the problem are as follows:

  • Issue Description: The same token is configured in both frps and frpc, but an error occurs during login: "token in login doesn't match token from configuration." The connection works fine when no token is set.
  • Version Information:
    • frpc version: 0.61.0
    • frps version: 0.61.0
  • System Architecture: Linux
  • Configuration Files:
    • The frps.toml and frpc.toml files both have the same token set to 12345678.
  • Logs:
    • Both frps and frpc logs show the error: "token in login doesn't match token from configuration."

Possible Causes

This issue may be caused by the following:

  • A mismatch in the token configurations between frps and frpc.
  • Issues during the reading or parsing of the token in the configuration files.

You can verify the following:

  1. Ensure the token settings in frps.toml and frpc.toml are completely identical.
  2. Confirm that the configuration file paths used when running frps and frpc are correct.
  3. Check if any other settings are overriding the token configuration.

If further investigation is needed, please provide specific file paths or related code changes for review.

<!-- gh-comment-id:2502626927 --> @fatedier commented on GitHub (Nov 27, 2024): Based on the description of the issue, the possible causes of the problem are as follows: - **Issue Description**: The same token is configured in both `frps` and `frpc`, but an error occurs during login: "token in login doesn't match token from configuration." The connection works fine when no token is set. - **Version Information**: - frpc version: 0.61.0 - frps version: 0.61.0 - **System Architecture**: Linux - **Configuration Files**: - The `frps.toml` and `frpc.toml` files both have the same token set to `12345678`. - **Logs**: - Both `frps` and `frpc` logs show the error: "token in login doesn't match token from configuration." ### Possible Causes This issue may be caused by the following: - A mismatch in the token configurations between `frps` and `frpc`. - Issues during the reading or parsing of the token in the configuration files. You can verify the following: 1. Ensure the token settings in `frps.toml` and `frpc.toml` are completely identical. 2. Confirm that the configuration file paths used when running `frps` and `frpc` are correct. 3. Check if any other settings are overriding the token configuration. If further investigation is needed, please provide specific file paths or related code changes for review.
Author
Owner

@AiENG07 commented on GitHub (Nov 28, 2024):

经过反复查询资料发现,直接执行./frps这个命令会直接运行默认配置,而不执行我设置好的frps.toml 。于是我把执行命令改为./frps -c frps.toml就可以了。不知道为什么会这样,按理来说我的文件夹下就两个文件,一个frps执行程序,一个frps.toml配置文件,直接运行./frps 应该会去读取我的toml配置,可是没有。

<!-- gh-comment-id:2505398318 --> @AiENG07 commented on GitHub (Nov 28, 2024): 经过反复查询资料发现,直接执行./frps这个命令会直接运行默认配置,而不执行我设置好的frps.toml 。于是我把执行命令改为./frps -c frps.toml就可以了。不知道为什么会这样,按理来说我的文件夹下就两个文件,一个frps执行程序,一个frps.toml配置文件,直接运行./frps 应该会去读取我的toml配置,可是没有。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3606
No description provided.