[GH-ISSUE #3903] Get real ip in 'ssh service' by 'frpc' #3096

Closed
opened 2026-05-05 14:00:15 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @youhuiji on GitHub (Dec 29, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3903

Bug Description

What should I do to get the real ip via frpc, because I see log files of people trying to burst my ssh service, but luckily I have authorized_key logon turned on and password verification turned off. I want to get the real ip and then automatically blacklist these illegal ip.
So how do I do this?

frpc Version

0.48

frps Version

0.48

System Architecture

linux/amd64

Configurations

Get real ip in 'ssh service' by 'frpc'

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @youhuiji on GitHub (Dec 29, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3903 ### Bug Description What should I do to get the real ip via frpc, because I see log files of people trying to burst my ssh service, but luckily I have authorized_key logon turned on and password verification turned off. I want to get the real ip and then automatically blacklist these illegal ip. So how do I do this? ### frpc Version 0.48 ### frps Version 0.48 ### System Architecture linux/amd64 ### Configurations Get real ip in 'ssh service' by 'frpc' ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [X] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 14:00:15 -06:00
Author
Owner

@superzjg commented on GitHub (Dec 29, 2023):

https://gofrp.org/zh-cn/docs/features/common/realip/

ps. In your v0.48, you should use the old reference.
https://github.com/fatedier/frp/blob/dev/conf/legacy/frpc_legacy_full.ini#L249-L259

<!-- gh-comment-id:1871949392 --> @superzjg commented on GitHub (Dec 29, 2023): https://gofrp.org/zh-cn/docs/features/common/realip/ ps. In your v0.48, you should use the old reference. https://github.com/fatedier/frp/blob/dev/conf/legacy/frpc_legacy_full.ini#L249-L259
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2024):

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1909291989 --> @github-actions[bot] commented on GitHub (Jan 25, 2024): Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Author
Owner

@AlexCai26 commented on GitHub (Jan 2, 2025):

@superzjg
According to the link, i tried the proxy config block below:

[[proxies]]
name = "ssh-aws-us-to-asus"
type = "tcp"
# 
localIP = "127.0.0.1"
localPort = 22
# 
remotePort = 18810
# 
transport.useEncryption = true
# 
transport.useCompression = true
# Forward Real IP to local
transport.proxyProtocolVersion = "v2"

The last line leads to the errors below when trying to connect the proxy:

# Via MobaXTerm
Incoming packet was garbled on decryption

# Via CMD on Windows
Bad packet length 1231976033.
ssh_dispatch_run_fatal: Connection to 43.134.111.111 port 18810: message authentication code incorrect

Could you please provide some advises on this ?

<!-- gh-comment-id:2567895744 --> @AlexCai26 commented on GitHub (Jan 2, 2025): @superzjg According to the link, i tried the proxy config block below: ```bash [[proxies]] name = "ssh-aws-us-to-asus" type = "tcp" # localIP = "127.0.0.1" localPort = 22 # remotePort = 18810 # transport.useEncryption = true # transport.useCompression = true # Forward Real IP to local transport.proxyProtocolVersion = "v2" ``` The last line leads to the errors below when trying to connect the proxy: ```bash # Via MobaXTerm Incoming packet was garbled on decryption # Via CMD on Windows Bad packet length 1231976033. ssh_dispatch_run_fatal: Connection to 43.134.111.111 port 18810: message authentication code incorrect ``` Could you please provide some advises on this ?
Author
Owner

@superzjg commented on GitHub (Jan 3, 2025):

@superzjg According to the link, i tried the proxy config block below:

[[proxies]]
name = "ssh-aws-us-to-asus"
type = "tcp"
# 
localIP = "127.0.0.1"
localPort = 22
# 
remotePort = 18810
# 
transport.useEncryption = true
# 
transport.useCompression = true
# Forward Real IP to local
transport.proxyProtocolVersion = "v2"

The last line leads to the errors below when trying to connect the proxy:

# Via MobaXTerm
Incoming packet was garbled on decryption

# Via CMD on Windows
Bad packet length 1231976033.
ssh_dispatch_run_fatal: Connection to 43.134.111.111 port 18810: message authentication code incorrect

Could you please provide some advises on this ?

Local services are required to support the Proxy Protocol protocol, such as nginx.

<!-- gh-comment-id:2568556381 --> @superzjg commented on GitHub (Jan 3, 2025): > @superzjg According to the link, i tried the proxy config block below: > > ```shell > [[proxies]] > name = "ssh-aws-us-to-asus" > type = "tcp" > # > localIP = "127.0.0.1" > localPort = 22 > # > remotePort = 18810 > # > transport.useEncryption = true > # > transport.useCompression = true > # Forward Real IP to local > transport.proxyProtocolVersion = "v2" > ``` > > The last line leads to the errors below when trying to connect the proxy: > > ```shell > # Via MobaXTerm > Incoming packet was garbled on decryption > > # Via CMD on Windows > Bad packet length 1231976033. > ssh_dispatch_run_fatal: Connection to 43.134.111.111 port 18810: message authentication code incorrect > ``` > > Could you please provide some advises on this ? Local services are required to support the Proxy Protocol protocol, such as nginx.
Author
Owner

@xZinio commented on GitHub (Jan 21, 2025):

So is there no way to make this work?

<!-- gh-comment-id:2603955267 --> @xZinio commented on GitHub (Jan 21, 2025): So is there no way to make this work?
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#3096
No description provided.