[GH-ISSUE #97] ssh没有正常工作 #44

Closed
opened 2026-05-05 11:36:26 -06:00 by gitea-mirror · 9 comments
Owner

Originally created by @SmarkSeven on GitHub (Aug 25, 2016).
Original GitHub issue: https://github.com/fatedier/frp/issues/97

按照示例配置启动frps和frpc之后,通过 ssh 访问内网机器,连接总是超时。
[root@iZ4i1kgqxZ ~]# ssh -oPort=6000 KIL@192.168.31.138 ssh: connect to host 192.168.31.138 port 6000: Connection timed out

Originally created by @SmarkSeven on GitHub (Aug 25, 2016). Original GitHub issue: https://github.com/fatedier/frp/issues/97 按照示例配置启动frps和frpc之后,通过 ssh 访问内网机器,连接总是超时。 `[root@iZ4i1kgqxZ ~]# ssh -oPort=6000 KIL@192.168.31.138 ssh: connect to host 192.168.31.138 port 6000: Connection timed out`
Author
Owner

@iseeyou commented on GitHub (Aug 25, 2016):

ssh可以,你看是不是自己哪个防火墙的问题。

<!-- gh-comment-id:242315837 --> @iseeyou commented on GitHub (Aug 25, 2016): ssh可以,你看是不是自己哪个防火墙的问题。
Author
Owner

@SmarkSeven commented on GitHub (Aug 25, 2016):

公网Linux服务器防火墙配置:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8001 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6000 -j ACCEPT

内网Mac服务器没有开启防火墙功能 @iseeyou

<!-- gh-comment-id:242317852 --> @SmarkSeven commented on GitHub (Aug 25, 2016): 公网Linux服务器防火墙配置: ``` -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 8001 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 7000 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 6000 -j ACCEPT ``` 内网Mac服务器没有开启防火墙功能 @iseeyou
Author
Owner

@flashsoft commented on GitHub (Aug 25, 2016):

ssh root@ip -p 端口

<!-- gh-comment-id:242350834 --> @flashsoft commented on GitHub (Aug 25, 2016): ssh root@ip -p 端口
Author
Owner

@SmarkSeven commented on GitHub (Aug 25, 2016):

仍然是连接超时

[root@iZ94i1kgqbxZ ~]# ssh SevenOne@192.168.1.4 -p 6000
ssh: connect to host 192.168.1.4 port 6000: Connection timed out

frps启动正常

[root@iZ94i1kgqbxZ service]# ./frps -c ./frps.ini
2016/08/25 19:10:30 [main.go:182] [I] Start frps success
2016/08/25 19:11:22 [control.go:314] [I] ProxyName [ssh], start proxy success 

frpc启动正常

➜ /Users/sevenone/Downloads/frp_0.8.1_darwin_amd64 >./frpc -c ./frpc.ini
2016/08/25 19:11:24 [main.go:109] [I] Start frpc success
2016/08/25 19:11:24 [control.go:185] [I] ProxyName [ssh], connect to server [120.25.147.61:7000] success!
2016/08/25 19:11:24 [control.go:193] [I] Start to send heartbeat to frps

@FlashSoft

<!-- gh-comment-id:242357882 --> @SmarkSeven commented on GitHub (Aug 25, 2016): 仍然是连接超时 ``` [root@iZ94i1kgqbxZ ~]# ssh SevenOne@192.168.1.4 -p 6000 ssh: connect to host 192.168.1.4 port 6000: Connection timed out ``` **frps启动正常** ``` [root@iZ94i1kgqbxZ service]# ./frps -c ./frps.ini 2016/08/25 19:10:30 [main.go:182] [I] Start frps success 2016/08/25 19:11:22 [control.go:314] [I] ProxyName [ssh], start proxy success ``` **frpc启动正常** ``` ➜ /Users/sevenone/Downloads/frp_0.8.1_darwin_amd64 >./frpc -c ./frpc.ini 2016/08/25 19:11:24 [main.go:109] [I] Start frpc success 2016/08/25 19:11:24 [control.go:185] [I] ProxyName [ssh], connect to server [120.25.147.61:7000] success! 2016/08/25 19:11:24 [control.go:193] [I] Start to send heartbeat to frps ``` @FlashSoft
Author
Owner

@flashsoft commented on GitHub (Aug 25, 2016):

怎么看你都应该是 ssh root@120.25.147.61 -p 6000吧

<!-- gh-comment-id:242371826 --> @flashsoft commented on GitHub (Aug 25, 2016): 怎么看你都应该是 ssh root@120.25.147.61 -p 6000吧
Author
Owner

@SmarkSeven commented on GitHub (Aug 25, 2016):

120.25.147.61 是公网IP
ssh root@120.25.147.61本就可以远程登录
ssh root@120.25.147.61 -p 6000这样做有什么额外的意义?
我想要的是从外网访问内网主机资源,so how to do?
@FlashSoft

<!-- gh-comment-id:242374133 --> @SmarkSeven commented on GitHub (Aug 25, 2016): 120.25.147.61 是公网IP ssh root@120.25.147.61本就可以远程登录 ssh root@120.25.147.61 -p 6000这样做有什么额外的意义? 我想要的是从外网访问内网主机资源,so how to do? @FlashSoft
Author
Owner

@iseeyou commented on GitHub (Aug 25, 2016):

@SmarkSeven 从外网访问内网,你应该是访问外网的ip,frp帮你打洞到内网。。。

<!-- gh-comment-id:242376771 --> @iseeyou commented on GitHub (Aug 25, 2016): @SmarkSeven 从外网访问内网,你应该是访问外网的ip,frp帮你打洞到内网。。。
Author
Owner

@SmarkSeven commented on GitHub (Aug 25, 2016):

也就是说这个访问行为同时有三个主机参与
1.我的电脑 、2.被访问的内网主机、3.搭桥的外网主机
今天第一次接触内外穿透,有很多地方不明白
@iseeyou 是这样吗

<!-- gh-comment-id:242378518 --> @SmarkSeven commented on GitHub (Aug 25, 2016): 也就是说这个访问行为同时有三个主机参与 1.我的电脑 、2.被访问的内网主机、3.搭桥的外网主机 今天第一次接触内外穿透,有很多地方不明白 @iseeyou 是这样吗
Author
Owner

@SmarkSeven commented on GitHub (Aug 25, 2016):

刚刚试了下
ssh user@xx.xx.xx.xx -p 6000

ssh -oPort=6000 user@xx.xx.xx.xx
这两种形式都可以
谢谢 @iseeyou @FlashSoft

<!-- gh-comment-id:242381965 --> @SmarkSeven commented on GitHub (Aug 25, 2016): 刚刚试了下 `ssh user@xx.xx.xx.xx -p 6000` 和 `ssh -oPort=6000 user@xx.xx.xx.xx` 这两种形式都可以 谢谢 @iseeyou @FlashSoft
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#44
No description provided.