[GH-ISSUE #956] 安装说明文档配置,无法ssh到内网服务器 #760

Closed
opened 2026-05-05 12:29:09 -06:00 by gitea-mirror · 9 comments
Owner

Originally created by @loveXMTX on GitHub (Oct 26, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/956

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
frp_0.21.0_linux_amd64

What operating system and processor architecture are you using (go env)?
server: centos7
client: centos7
Configures you used:

# cat frps.ini 
[common]
bind_port = 4396
bind_addr=0.0.0.0
auto_token=frp
# cat frpc.ini 
[common]
server_addr = x.x.x.x
server_port = 4396
auto_token=frp

[ssh_87]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 10085

Steps to reproduce the issue:

  1. ./frps -c ./frps.ini
  2. ./frpc -c ./frpc.ini

Describe the results you received:
我不能利用服务端的端口ssh本地的客户端

2018/10/26 15:45:30 [I] [proxy_manager.go:300] proxy removed: []
2018/10/26 15:45:30 [I] [proxy_manager.go:310] proxy added: [ssh_87]
2018/10/26 15:45:30 [I] [proxy_manager.go:333] visitor removed: []
2018/10/26 15:45:30 [I] [proxy_manager.go:342] visitor added: []
2018/10/26 15:45:30 [I] [control.go:246] [dd041d1da31a9a27] login to server success, get run id [dd041d1da31a9a27], server udp port [0]
2018/10/26 15:45:30 [I] [control.go:169] [dd041d1da31a9a27] [ssh_87] start proxy success
2018/10/26 15:46:49 [I] [service.go:319] client login info: ip [x.x.x.x:46720] version [0.21.0] hostname [] os [linux] arch [amd64]
2018/10/26 15:46:49 [I] [proxy.go:217] [dd041d1da31a9a27] [ssh_87] tcp proxy listen port [10085]
2018/10/26 15:46:49 [I] [control.go:335] [dd041d1da31a9a27] new proxy [ssh_87] success

为什么会连不上呢,下面是服务端的端口情况:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2661/sshd           
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      21133/postgres      
tcp6       0      0 :::10085                :::*                    LISTEN      20429/./frps        
tcp6       0      0 :::3306                 :::*                    LISTEN      5189/mysqld         
tcp6       0      0 :::4396                 :::*                    LISTEN      20429/./frps        
tcp6       0      0 :::5432                 :::*                    LISTEN      21133/postgres   

frps的状态信息:2018/10/26 16:39:27 [I] [service.go:130] frps tcp listen on 0.0.0.0:7000 2018/10/26 16:39:27 [I] [root.go:207] Start frps success
frpc:frpc get status error: admin_port shoud be set if you want to get proxy status
Describe the results you expected:
我希望能够利用公网的端口直接ssh内网的服务器

Additional information you deem important (e.g. issue happens only occasionally):
这是第一次配置,直接就不能使用

Can you point out what caused this issue (optional)

Originally created by @loveXMTX on GitHub (Oct 26, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/956 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** frp_0.21.0_linux_amd64 **What operating system and processor architecture are you using (`go env`)?** server: centos7 client: centos7 **Configures you used:** ``` # cat frps.ini [common] bind_port = 4396 bind_addr=0.0.0.0 auto_token=frp ``` ``` # cat frpc.ini [common] server_addr = x.x.x.x server_port = 4396 auto_token=frp [ssh_87] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 10085 ``` **Steps to reproduce the issue:** 1. ./frps -c ./frps.ini 2. ./frpc -c ./frpc.ini **Describe the results you received:** 我不能利用服务端的端口ssh本地的客户端 ``` 2018/10/26 15:45:30 [I] [proxy_manager.go:300] proxy removed: [] 2018/10/26 15:45:30 [I] [proxy_manager.go:310] proxy added: [ssh_87] 2018/10/26 15:45:30 [I] [proxy_manager.go:333] visitor removed: [] 2018/10/26 15:45:30 [I] [proxy_manager.go:342] visitor added: [] 2018/10/26 15:45:30 [I] [control.go:246] [dd041d1da31a9a27] login to server success, get run id [dd041d1da31a9a27], server udp port [0] 2018/10/26 15:45:30 [I] [control.go:169] [dd041d1da31a9a27] [ssh_87] start proxy success ``` ``` 2018/10/26 15:46:49 [I] [service.go:319] client login info: ip [x.x.x.x:46720] version [0.21.0] hostname [] os [linux] arch [amd64] 2018/10/26 15:46:49 [I] [proxy.go:217] [dd041d1da31a9a27] [ssh_87] tcp proxy listen port [10085] 2018/10/26 15:46:49 [I] [control.go:335] [dd041d1da31a9a27] new proxy [ssh_87] success ``` 为什么会连不上呢,下面是服务端的端口情况: ``` Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2661/sshd tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 21133/postgres tcp6 0 0 :::10085 :::* LISTEN 20429/./frps tcp6 0 0 :::3306 :::* LISTEN 5189/mysqld tcp6 0 0 :::4396 :::* LISTEN 20429/./frps tcp6 0 0 :::5432 :::* LISTEN 21133/postgres ``` frps的状态信息:```2018/10/26 16:39:27 [I] [service.go:130] frps tcp listen on 0.0.0.0:7000 2018/10/26 16:39:27 [I] [root.go:207] Start frps success``` frpc:```frpc get status error: admin_port shoud be set if you want to get proxy status``` **Describe the results you expected:** 我希望能够利用公网的端口直接ssh内网的服务器 **Additional information you deem important (e.g. issue happens only occasionally):** 这是第一次配置,直接就不能使用 **Can you point out what caused this issue (optional)**
Author
Owner

@hallkk commented on GitHub (Oct 30, 2018):

列一下详细的日志,例如ssh xx@remote-ip -p 10085 -v的输出

<!-- gh-comment-id:434162913 --> @hallkk commented on GitHub (Oct 30, 2018): 列一下详细的日志,例如`ssh xx@remote-ip -p 10085 -v`的输出
Author
Owner

@loveXMTX commented on GitHub (Oct 30, 2018):

列一下详细的日志,例如ssh xx@remote-ip -p 10085 -v的输出

OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to 120.79.185.80 [120.79.185.80] port 10085.

等待很久连不上,time out了

<!-- gh-comment-id:434163372 --> @loveXMTX commented on GitHub (Oct 30, 2018): > 列一下详细的日志,例如`ssh xx@remote-ip -p 10085 -v`的输出 ``` OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 56: Applying options for * debug1: Connecting to 120.79.185.80 [120.79.185.80] port 10085. ``` 等待很久连不上,time out了
Author
Owner

@loveXMTX commented on GitHub (Oct 30, 2018):

列一下详细的日志,例如ssh xx@remote-ip -p 10085 -v的输出
客户端日志

2018/10/30 11:33:07 [I] [proxy_manager.go:300] proxy removed: []
2018/10/30 11:33:07 [I] [proxy_manager.go:310] proxy added: [ssh_87]
2018/10/30 11:33:07 [I] [proxy_manager.go:333] visitor removed: []
2018/10/30 11:33:07 [I] [proxy_manager.go:342] visitor added: []
2018/10/30 11:33:07 [I] [control.go:246] [953cd2f5ef2df795] login to server success, get run id [953cd2f5ef2df795], server udp port [0]
2018/10/30 11:33:07 [I] [control.go:169] [953cd2f5ef2df795] [ssh_87] start proxy success

服务端日志

2018/10/30 19:55:08 [I] [service.go:319] client login info: ip [58.48.158.243:34438] version [0.21.0] hostname [] os [linux] arch [amd64]
2018/10/30 19:55:08 [I] [proxy.go:217] [953cd2f5ef2df795] [ssh_87] tcp proxy listen port [10085]
2018/10/30 19:55:08 [I] [control.go:335] [953cd2f5ef2df795] new proxy [ssh_87] success
<!-- gh-comment-id:434273459 --> @loveXMTX commented on GitHub (Oct 30, 2018): > 列一下详细的日志,例如`ssh xx@remote-ip -p 10085 -v`的输出 客户端日志 ``` 2018/10/30 11:33:07 [I] [proxy_manager.go:300] proxy removed: [] 2018/10/30 11:33:07 [I] [proxy_manager.go:310] proxy added: [ssh_87] 2018/10/30 11:33:07 [I] [proxy_manager.go:333] visitor removed: [] 2018/10/30 11:33:07 [I] [proxy_manager.go:342] visitor added: [] 2018/10/30 11:33:07 [I] [control.go:246] [953cd2f5ef2df795] login to server success, get run id [953cd2f5ef2df795], server udp port [0] 2018/10/30 11:33:07 [I] [control.go:169] [953cd2f5ef2df795] [ssh_87] start proxy success ``` 服务端日志 ``` 2018/10/30 19:55:08 [I] [service.go:319] client login info: ip [58.48.158.243:34438] version [0.21.0] hostname [] os [linux] arch [amd64] 2018/10/30 19:55:08 [I] [proxy.go:217] [953cd2f5ef2df795] [ssh_87] tcp proxy listen port [10085] 2018/10/30 19:55:08 [I] [control.go:335] [953cd2f5ef2df795] new proxy [ssh_87] success ```
Author
Owner

@jamy325 commented on GitHub (Oct 30, 2018):

防火墙挡住了吧.

<!-- gh-comment-id:434284161 --> @jamy325 commented on GitHub (Oct 30, 2018): 防火墙挡住了吧.
Author
Owner

@loveXMTX commented on GitHub (Oct 31, 2018):

防火墙挡住了吧.

没有啊,这是我的端口使用情况:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2661/sshd           
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      2544/postgres       
tcp6       0      0 :::10085                :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::3306                 :::*                    LISTEN      5189/mysqld         
tcp6       0      0 :::4396                 :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::5432                 :::*                    LISTEN      2544/postgres  
<!-- gh-comment-id:434537146 --> @loveXMTX commented on GitHub (Oct 31, 2018): > 防火墙挡住了吧. 没有啊,这是我的端口使用情况: ``` Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2661/sshd tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 2544/postgres tcp6 0 0 :::10085 :::* LISTEN 29580/./frps tcp6 0 0 :::3306 :::* LISTEN 5189/mysqld tcp6 0 0 :::4396 :::* LISTEN 29580/./frps tcp6 0 0 :::5432 :::* LISTEN 2544/postgres ```
Author
Owner

@hallkk commented on GitHub (Oct 31, 2018):

防火墙挡住了吧.

没有啊,这是我的端口使用情况:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2661/sshd           
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      2544/postgres       
tcp6       0      0 :::10085                :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::3306                 :::*                    LISTEN      5189/mysqld         
tcp6       0      0 :::4396                 :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::5432                 :::*                    LISTEN      2544/postgres  

看你的IP,应该是阿里云的服务器
确认下是不是安全规则的限制,没有开发目标端口

<!-- gh-comment-id:434623849 --> @hallkk commented on GitHub (Oct 31, 2018): > > 防火墙挡住了吧. > > 没有啊,这是我的端口使用情况: > > ``` > Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name > tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2661/sshd > tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 2544/postgres > tcp6 0 0 :::10085 :::* LISTEN 29580/./frps > tcp6 0 0 :::3306 :::* LISTEN 5189/mysqld > tcp6 0 0 :::4396 :::* LISTEN 29580/./frps > tcp6 0 0 :::5432 :::* LISTEN 2544/postgres > ``` 看你的IP,应该是阿里云的服务器 确认下是不是安全规则的限制,没有开发目标端口
Author
Owner

@loveXMTX commented on GitHub (Nov 1, 2018):

防火墙挡住了吧.

没有啊,这是我的端口使用情况:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2661/sshd           
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      2544/postgres       
tcp6       0      0 :::10085                :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::3306                 :::*                    LISTEN      5189/mysqld         
tcp6       0      0 :::4396                 :::*                    LISTEN      29580/./frps        
tcp6       0      0 :::5432                 :::*                    LISTEN      2544/postgres  

看你的IP,应该是阿里云的服务器
确认下是不是安全规则的限制,没有开发目标端口

谢谢呀,还果然时端口没开放。

<!-- gh-comment-id:434913214 --> @loveXMTX commented on GitHub (Nov 1, 2018): > > > 防火墙挡住了吧. > > > > > > 没有啊,这是我的端口使用情况: > > ``` > > Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name > > tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2661/sshd > > tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 2544/postgres > > tcp6 0 0 :::10085 :::* LISTEN 29580/./frps > > tcp6 0 0 :::3306 :::* LISTEN 5189/mysqld > > tcp6 0 0 :::4396 :::* LISTEN 29580/./frps > > tcp6 0 0 :::5432 :::* LISTEN 2544/postgres > > ``` > > 看你的IP,应该是阿里云的服务器 > 确认下是不是安全规则的限制,没有开发目标端口 谢谢呀,还果然时端口没开放。
Author
Owner

@BriFuture commented on GitHub (Dec 22, 2019):

给 frps 开放了所有端口
image

但是 ssh 无法打开
image

把remote_port 改成 0, 提示 no available port
是不是服务器上还要做一些配置呢

<!-- gh-comment-id:568240590 --> @BriFuture commented on GitHub (Dec 22, 2019): 给 frps 开放了所有端口 ![image](https://user-images.githubusercontent.com/7582298/71319006-54586500-24d3-11ea-8dcc-f56ab5fdbb88.png) 但是 ssh 无法打开 ![image](https://user-images.githubusercontent.com/7582298/71319015-74882400-24d3-11ea-884d-24f20f15f671.png) 把remote_port 改成 0, 提示 no available port 是不是服务器上还要做一些配置呢
Author
Owner

@BriFuture commented on GitHub (Dec 22, 2019):

啊是我服务器上的配置有问题,服务器上的 allow_ports 没有设置好

<!-- gh-comment-id:568241777 --> @BriFuture commented on GitHub (Dec 22, 2019): 啊是我服务器上的配置有问题,服务器上的 allow_ports 没有设置好
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#760
No description provided.