[GH-ISSUE #4556] [STCP ssh gateway INFO] - Information about Usage Secret_TCP/Visitors through ssh gateway #3602

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

Originally created by @fabiopierrisynclab on GitHub (Nov 24, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4556

Bug Description

Hi @fatedier
I'm trying to setup an stcp tunnel with frp via the ssh gateway.
On machine A I started frp with the following command to forward ssh port 22:

ssh -p 2222 -R :80:127.0.0.1:22 v0@frp.mydomain.link stcp -n="test-22-ssh-secret" --sk=abc --allow-users="*" -u=ssh -t=mytoken

Frp start with:

frp (via SSH) (Ctrl+C to quit)

User: ssh
ProxyName: ssh.test-22-ssh-secret
Type: stcp
RemoteAddress: 

Note: RemoteAddress is empty... Is correct?

Furthermore
The problem is that I haven't quite understood how to start the frp ssh tunnel in visitor to connect to machine A.
I tried to forward the remote port (22) to local port (9000):

ssh -p 2222 -L localhost:9000:127.0.0.1:22 v0@frp.mydomain.link stcp -n="test-22-ssh-secret" --sk=abc -u=ssh -t=mytoken

The connection fail.

Could you kindly explain to me how to use ssh gateway to configure stcp (secret_ssh and visitors) on both machine A and machine B.
What I want to get is the equivalent of this toml configuration in stcp ssh gateway for machine A and B:

[[proxies]]
name = "secret-tcp"
type = "stcp"
secretKey = "abcdefg"
localIP = "127.0.0.1"
localPort = 22
allowUsers = ["*"]

Machine B

[[visitors]]
name = "tcp-visitor"
type = "stcp"
serverName = "secret-tcp"
secretKey = "abcdefg"
bindAddr = "127.0.0.1"
bindPort = 9000

can you show me the complete commands?

machine A (stcp secret_ssh): ssh command=??
Machine B (stcp visitors): ssh command=??

frpc Version

0.61.0

frps Version

0.61.0

System Architecture

linux/amd64

Configurations

frps configuration:

bindPort = 7835
kcpBindPort = 6000
quicBindPort = 7000
sshTunnelGateway.bindPort = 2222

bindAddr = "0.0.0.0"
proxyBindAddr = "0.0.0.0"

transport.maxPoolCount = 50

vhostHTTPPort = 8080

vhostHTTPTimeout = 7200

webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "admin"
webServer.password = "mytoken"

auth.method = "token"
auth.token = "mytoken"

subDomainHost = "frp.mydomain.link "

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 @fabiopierrisynclab on GitHub (Nov 24, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4556 ### Bug Description Hi @fatedier I'm trying to setup an stcp tunnel with frp via the ssh gateway. On machine A I started frp with the following command to forward ssh port 22: ``` ssh -p 2222 -R :80:127.0.0.1:22 v0@frp.mydomain.link stcp -n="test-22-ssh-secret" --sk=abc --allow-users="*" -u=ssh -t=mytoken ``` Frp start with: ``` frp (via SSH) (Ctrl+C to quit) User: ssh ProxyName: ssh.test-22-ssh-secret Type: stcp RemoteAddress: ``` Note: RemoteAddress is empty... Is correct? Furthermore The problem is that I haven't quite understood how to start the frp ssh tunnel in visitor to connect to machine A. I tried to forward the remote port (22) to local port (9000): ``` ssh -p 2222 -L localhost:9000:127.0.0.1:22 v0@frp.mydomain.link stcp -n="test-22-ssh-secret" --sk=abc -u=ssh -t=mytoken ``` The connection fail. Could you kindly explain to me how to use ssh gateway to configure stcp (secret_ssh and visitors) on both machine A and machine B. What I want to get is the equivalent of this toml configuration in stcp ssh gateway for machine A and B: ``` [[proxies]] name = "secret-tcp" type = "stcp" secretKey = "abcdefg" localIP = "127.0.0.1" localPort = 22 allowUsers = ["*"] ``` Machine B ``` [[visitors]] name = "tcp-visitor" type = "stcp" serverName = "secret-tcp" secretKey = "abcdefg" bindAddr = "127.0.0.1" bindPort = 9000 ``` can you show me the complete commands? machine A (stcp secret_ssh): ssh command=?? Machine B (stcp visitors): ssh command=?? ### frpc Version 0.61.0 ### frps Version 0.61.0 ### System Architecture linux/amd64 ### Configurations frps configuration: bindPort = 7835 kcpBindPort = 6000 quicBindPort = 7000 sshTunnelGateway.bindPort = 2222 bindAddr = "0.0.0.0" proxyBindAddr = "0.0.0.0" transport.maxPoolCount = 50 vhostHTTPPort = 8080 vhostHTTPTimeout = 7200 webServer.addr = "0.0.0.0" webServer.port = 7500 webServer.user = "admin" webServer.password = "mytoken" auth.method = "token" auth.token = "mytoken" subDomainHost = "frp.mydomain.link " ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [X] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 14:18:47 -06:00
Author
Owner

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

The SSH gateway method does not support being used as a visitor client.

<!-- gh-comment-id:2496664107 --> @fatedier commented on GitHub (Nov 25, 2024): The SSH gateway method does not support being used as a visitor client.
Author
Owner

@fabiopierrisynclab commented on GitHub (Nov 26, 2024):

Ok thanks!
Any chance to implement this feature?
It would be great to have the whole secret/visitors loop available via ssh.

<!-- gh-comment-id:2499379438 --> @fabiopierrisynclab commented on GitHub (Nov 26, 2024): Ok thanks! Any chance to implement this feature? It would be great to have the whole secret/visitors loop available via ssh.
Author
Owner

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

It's relatively complex, and there are currently no plans to support it.

<!-- gh-comment-id:2499586454 --> @fatedier commented on GitHub (Nov 26, 2024): It's relatively complex, and there are currently no plans to support it.
Author
Owner

@fabiopierrisynclab commented on GitHub (Nov 26, 2024):

@fatedier Ok Thanks!
Good Work!

<!-- gh-comment-id:2500432874 --> @fabiopierrisynclab commented on GitHub (Nov 26, 2024): @fatedier Ok Thanks! Good Work!
Author
Owner

@github-actions[bot] commented on GitHub (Dec 18, 2024):

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

<!-- gh-comment-id:2549996468 --> @github-actions[bot] commented on GitHub (Dec 18, 2024): Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#3602
No description provided.