[GH-ISSUE #3144] stcp搭建完之后无法连接 #2523

Closed
opened 2026-05-05 13:37:32 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @tiriolo on GitHub (Oct 25, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3144

Bug Description

事情是这样的
我想通过自己的mac远程访问家里面的ubuntu系统的工作站
每次在mac上输入ssh -oPort=6000 [ubuntu的用户名]@127.0.0.1都会提示:
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port [bind_port]

同时ubuntu系统的工作站提示:
[E] [proxy.go:795] [456249bfbec7724c] [secret_ssh] connect run to local service [127.0.0.1:22] error: dial tcp 127.0.0.1:22 : connect: connection refused

起初我怀疑是ubuntu的端口没有开启,但似乎当我开启ufw,并放行22端口后,依然出现同样的错误,我还尝试检查了ssh的配置文件,似乎并没有什么问题,所以到底问题出在哪里,该如何解决呢

frpc Version

0.44

frps Version

0.44

System Architecture

linux/amd64 , mac

Configurations

mac上的frpc.ini:
[common]
server_addr = x.x.x.x
server_port = xxxxx
token = xxxxxxxx

[secret_ssh_visitor]
type = stcp
role = visitor
sk = xxxx
server_name = secret_ssh
bind_addr = 127.0.0.1
bind_port = 39725

ubuntu上的frpc.ini
[common]
server_addr = x.x.x.x
server_port = xxxxxx
token = xxxxx

[secret_ssh]
type = stcp
sk = xxxxx
local_ip = 127.0.0.1
local_port = 22

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 @tiriolo on GitHub (Oct 25, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3144 ### Bug Description 事情是这样的 我想通过自己的mac远程访问家里面的ubuntu系统的工作站 每次在mac上输入ssh -oPort=6000 [ubuntu的用户名]@127.0.0.1都会提示: kex_exchange_identification: Connection closed by remote host Connection closed by 127.0.0.1 port [bind_port] 同时ubuntu系统的工作站提示: [E] [proxy.go:795] [456249bfbec7724c] [secret_ssh] connect run to local service [127.0.0.1:22] error: dial tcp 127.0.0.1:22 : connect: connection refused 起初我怀疑是ubuntu的端口没有开启,但似乎当我开启ufw,并放行22端口后,依然出现同样的错误,我还尝试检查了ssh的配置文件,似乎并没有什么问题,所以到底问题出在哪里,该如何解决呢 ### frpc Version 0.44 ### frps Version 0.44 ### System Architecture linux/amd64 , mac ### Configurations mac上的frpc.ini: [common] server_addr = x.x.x.x server_port = xxxxx token = xxxxxxxx [secret_ssh_visitor] type = stcp role = visitor sk = xxxx server_name = secret_ssh bind_addr = 127.0.0.1 bind_port = 39725 ubuntu上的frpc.ini [common] server_addr = x.x.x.x server_port = xxxxxx token = xxxxx [secret_ssh] type = stcp sk = xxxxx local_ip = 127.0.0.1 local_port = 22 ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:37:33 -06:00
Author
Owner

@Becods commented on GitHub (Oct 28, 2022):

bind_port = 39725

请指定端口

<!-- gh-comment-id:1294969418 --> @Becods commented on GitHub (Oct 28, 2022): `bind_port = 39725` 请指定端口
Author
Owner

@ahmr-bot-old commented on GitHub (Nov 13, 2022):

您 ssh 时链接的端口应该是使用127.0.0.1的39725端口的,其次是这个报错您可以再ubuntu检查一下22端口是否监听 lsof -i:22

<!-- gh-comment-id:1312655041 --> @ahmr-bot-old commented on GitHub (Nov 13, 2022): 您 ssh 时链接的端口应该是使用127.0.0.1的39725端口的,其次是这个报错您可以再ubuntu检查一下22端口是否监听 lsof -i:22
Author
Owner

@github-actions[bot] commented on GitHub (Dec 14, 2022):

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

<!-- gh-comment-id:1350176297 --> @github-actions[bot] commented on GitHub (Dec 14, 2022): Issues go stale after 30d 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#2523
No description provided.