[GH-ISSUE #3604] Connection closed by remote host The Connection closed by X.X.X.X port 6000 #2877

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

Originally created by @JohnGump on GitHub (Sep 8, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3604

Bug Description

After following the configuration instructions, I ran frpc and frps. The Connection between the server and the client was normal, but when I used ssh to connect the client, an error occurred: kex_exchange_identification: Connection closed by remote host
The Connection closed by 43.134.20.100 port 6000

我在按照说明配置后,运行了frpc与frps,服务端与客户端链接正常,但是用ssh连接客户端的时候会报错:kex_exchange_identification: Connection closed by remote host
Connection closed by 43.134.20.100 port 6000

frpc Version

frp_0.51.3_linux_amd64

frps Version

frp_0.51.3_linux_amd64

System Architecture

Linux/amd64

Configurations

For Server:
System:Ubuntu Server 22.04 LTS 64(From Tencent Cloud server)

frps.ini
bind_port = 7000

For Client
System:Ubuntu Server 22.04 LTS 64
frpc.ini

[common]
server_addr = 43.134.20.100(For testing, I have turned off the firewall, the security group has been set to all pass, and I will keep the ports open for everyone to test)
server_port = 7000

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

None of these devices use docker
以上设备均没有使用docker
为了测试,我已经关闭防火墙,安全组已经设置为全部通过,我会持续开放端口以供大家测试以解决问题

Logs

ssh -oPort=6000 ubuntu@43.134.20.100
kex_exchange_identification: Connection closed by remote host
Connection closed by 43.134.20.100 port 6000

Server log:

2023/09/08 23:17:01 [I] [root.go:204] frps uses config file: ./frps.ini
2023/09/08 23:17:01 [I] [service.go:206] frps tcp listen on 0.0.0.0:7000
2023/09/08 23:17:01 [I] [root.go:213] frps started successfully
2023/09/08 23:17:04 [I] [service.go:539] [efa3b32e12fbc801] client login info: ip [171.100.76.93:58802] version [0.51.3] hostname [] os [linux] arch [amd64]
2023/09/08 23:17:04 [I] [tcp.go:81] [efa3b32e12fbc801] [ssh] tcp proxy listen port [6000]
2023/09/08 23:17:04 [I] [control.go:497] [efa3b32e12fbc801] new proxy [ssh] type [tcp] success
2023/09/08 23:17:19 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:54667]
2023/09/08 23:17:21 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:48908]
2023/09/08 23:17:23 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:54670]

Client log:

2023/09/08 23:17:04 [I] [service.go:214] [efa3b32e12fbc801] try to reconnect to server...
2023/09/08 23:17:04 [I] [service.go:301] [efa3b32e12fbc801] login to server success, get run id [efa3b32e12fbc801]
2023/09/08 23:17:04 [I] [proxy_manager.go:150] [efa3b32e12fbc801] proxy added: [ssh]
2023/09/08 23:17:04 [I] [control.go:172] [efa3b32e12fbc801] [ssh] start proxy success
2023/09/08 23:17:19 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused
2023/09/08 23:17:21 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused
2023/09/08 23:17:24 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused

Steps to reproduce

1、Set up and start the server
设置并启动服务端
2、Set up and start the client
设置并启动客户端
3、Try to connect to the client with a third device
尝试用第三台设备连接客户端
(The specific configuration is given above
)具体配置上面已经给出

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @JohnGump on GitHub (Sep 8, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3604 ### Bug Description After following the configuration instructions, I ran frpc and frps. The Connection between the server and the client was normal, but when I used ssh to connect the client, an error occurred: kex_exchange_identification: Connection closed by remote host The Connection closed by 43.134.20.100 port 6000 我在按照说明配置后,运行了frpc与frps,服务端与客户端链接正常,但是用ssh连接客户端的时候会报错:kex_exchange_identification: Connection closed by remote host Connection closed by 43.134.20.100 port 6000 ### frpc Version frp_0.51.3_linux_amd64 ### frps Version frp_0.51.3_linux_amd64 ### System Architecture Linux/amd64 ### Configurations For Server: System:Ubuntu Server 22.04 LTS 64(From Tencent Cloud server) ``` frps.ini bind_port = 7000 ``` For Client System:Ubuntu Server 22.04 LTS 64 frpc.ini ``` [common] server_addr = 43.134.20.100(For testing, I have turned off the firewall, the security group has been set to all pass, and I will keep the ports open for everyone to test) server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 ``` None of these devices use docker 以上设备均没有使用docker 为了测试,我已经关闭防火墙,安全组已经设置为全部通过,我会持续开放端口以供大家测试以解决问题 ### Logs ``` ssh -oPort=6000 ubuntu@43.134.20.100 kex_exchange_identification: Connection closed by remote host Connection closed by 43.134.20.100 port 6000 ``` Server log: ``` 2023/09/08 23:17:01 [I] [root.go:204] frps uses config file: ./frps.ini 2023/09/08 23:17:01 [I] [service.go:206] frps tcp listen on 0.0.0.0:7000 2023/09/08 23:17:01 [I] [root.go:213] frps started successfully 2023/09/08 23:17:04 [I] [service.go:539] [efa3b32e12fbc801] client login info: ip [171.100.76.93:58802] version [0.51.3] hostname [] os [linux] arch [amd64] 2023/09/08 23:17:04 [I] [tcp.go:81] [efa3b32e12fbc801] [ssh] tcp proxy listen port [6000] 2023/09/08 23:17:04 [I] [control.go:497] [efa3b32e12fbc801] new proxy [ssh] type [tcp] success 2023/09/08 23:17:19 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:54667] 2023/09/08 23:17:21 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:48908] 2023/09/08 23:17:23 [I] [proxy.go:199] [efa3b32e12fbc801] [ssh] get a user connection [171.100.76.93:54670] ``` Client log: ``` 2023/09/08 23:17:04 [I] [service.go:214] [efa3b32e12fbc801] try to reconnect to server... 2023/09/08 23:17:04 [I] [service.go:301] [efa3b32e12fbc801] login to server success, get run id [efa3b32e12fbc801] 2023/09/08 23:17:04 [I] [proxy_manager.go:150] [efa3b32e12fbc801] proxy added: [ssh] 2023/09/08 23:17:04 [I] [control.go:172] [efa3b32e12fbc801] [ssh] start proxy success 2023/09/08 23:17:19 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused 2023/09/08 23:17:21 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused 2023/09/08 23:17:24 [E] [proxy.go:197] [efa3b32e12fbc801] [ssh] connect to local service [192.168.1.1:22] error: dial tcp 192.168.1.1:22: connect: connection refused ``` ### Steps to reproduce 1、Set up and start the server 设置并启动服务端 2、Set up and start the client 设置并启动客户端 3、Try to connect to the client with a third device 尝试用第三台设备连接客户端 (The specific configuration is given above )具体配置上面已经给出 ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
Author
Owner

@fatedier commented on GitHub (Sep 9, 2023):

Google 一下

大概能看出来主要是密钥/认证方面的问题

<!-- gh-comment-id:1712387873 --> @fatedier commented on GitHub (Sep 9, 2023): [Google](https://www.google.com/search?q=kex_exchange_identification+connection+closed+by+remote+host+%E8%A7%A3%E5%86%B3&newwindow=1&sca_esv=563900801&sxsrf=AB5stBgRskQwRLYmm3ezMHyRbRcUVGa9oQ%3A1694225798596&ei=htX7ZIrpI-zfkPIP6OKDqAg&oq=kex_exchange_identification%3A+Connection+closed+by+remote+host+&gs_lp=Egxnd3Mtd2l6LXNlcnAiPmtleF9leGNoYW5nZV9pZGVudGlmaWNhdGlvbjogQ29ubmVjdGlvbiBjbG9zZWQgYnkgcmVtb3RlIGhvc3QgKgIIAjIEECMYJzIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjFHlDgAljKE3AFeAGQAQCYAekBoAHcB6oBBTAuNC4xuAEDyAEA-AEBwgIKEAAYRxjWBBiwA8ICBBAAGB7CAgYQABgIGB7CAggQABgIGB4YCuIDBBgAIEGIBgGQBgo&sclient=gws-wiz-serp) 一下 大概能看出来主要是密钥/认证方面的问题
Author
Owner

@JohnGump commented on GitHub (Sep 9, 2023):

Google 一下

大概能看出来主要是密钥/认证方面的问题

但是在局域网是可以连接的

<!-- gh-comment-id:1712412270 --> @JohnGump commented on GitHub (Sep 9, 2023): > [Google](https://www.google.com/search?q=kex_exchange_identification+connection+closed+by+remote+host+%E8%A7%A3%E5%86%B3&newwindow=1&sca_esv=563900801&sxsrf=AB5stBgRskQwRLYmm3ezMHyRbRcUVGa9oQ%3A1694225798596&ei=htX7ZIrpI-zfkPIP6OKDqAg&oq=kex_exchange_identification%3A+Connection+closed+by+remote+host+&gs_lp=Egxnd3Mtd2l6LXNlcnAiPmtleF9leGNoYW5nZV9pZGVudGlmaWNhdGlvbjogQ29ubmVjdGlvbiBjbG9zZWQgYnkgcmVtb3RlIGhvc3QgKgIIAjIEECMYJzIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjFHlDgAljKE3AFeAGQAQCYAekBoAHcB6oBBTAuNC4xuAEDyAEA-AEBwgIKEAAYRxjWBBiwA8ICBBAAGB7CAgYQABgIGB7CAggQABgIGB4YCuIDBBgAIEGIBgGQBgo&sclient=gws-wiz-serp) 一下 > > 大概能看出来主要是密钥/认证方面的问题 但是在局域网是可以连接的
Author
Owner

@JohnGump commented on GitHub (Sep 11, 2023):

MacBook-Pro ~ % ssh -oPort=6000 johnBS@43.134.20.100 -vvv
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 43.134.20.100 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/wangbaohua/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/wangbaohua/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to 43.134.20.100 [43.134.20.100] port 6000.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address 43.134.20.100 port 6000: Connection refused
ssh: connect to host 43.134.20.100 port 6000: Connection refused
<!-- gh-comment-id:1713495030 --> @JohnGump commented on GitHub (Sep 11, 2023): ``` MacBook-Pro ~ % ssh -oPort=6000 johnBS@43.134.20.100 -vvv OpenSSH_9.0p1, LibreSSL 3.3.6 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug2: resolve_canonicalize: hostname 43.134.20.100 is address debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/wangbaohua/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/wangbaohua/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug3: ssh_connect_direct: entering debug1: Connecting to 43.134.20.100 [43.134.20.100] port 6000. debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address 43.134.20.100 port 6000: Connection refused ssh: connect to host 43.134.20.100 port 6000: Connection refused ```
Author
Owner

@fatedier commented on GitHub (Sep 11, 2023):

@JohnGump 爱发电上私聊你了,直接在那个上面说吧,这个 issue 就先关闭了。

<!-- gh-comment-id:1713797316 --> @fatedier commented on GitHub (Sep 11, 2023): @JohnGump 爱发电上私聊你了,直接在那个上面说吧,这个 issue 就先关闭了。
Author
Owner

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

我也遇到了同样的问题,可否跟您联系?

<!-- gh-comment-id:1871685397 --> @wslbby commented on GitHub (Dec 29, 2023): 我也遇到了同样的问题,可否跟您联系?
Author
Owner

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

我也遇到了完全同样的问题,最后怎么解决的?@JohnGump

<!-- gh-comment-id:2567856025 --> @fangxu622 commented on GitHub (Jan 2, 2025): 我也遇到了完全同样的问题,最后怎么解决的?@JohnGump
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#2877
No description provided.