[GH-ISSUE #1436] How can I connect to WSL in my PC? #1129

Closed
opened 2026-05-05 12:43:31 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @jiaoruohong on GitHub (Sep 11, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1436

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

What operating system and processor architecture are you using (go env)?
Windows 64

Configures you used:

  1 [common]                                                                                                                                          
  2 server_addr = myserver.xyz                                                                                                                  
  3 server_port = 7000                                                                                                                                
  4                                                                                                                                                   
  5 [ssh_win_pc]                                                                                                                                      
  6 type = tcp                                                                                                                                        
  7 local_ip = 127.0.0.1                                                                                                                              
  8 local_port = 22                                                                                                                                   
  9 remote_port = 6000                                                                                                                                
 10                                                                                                                                                   
 11 [ssh_ubuntu_pc]                                                                                                                                   
 12 type = tcp                                                                                                                                        
 13 local_ip = 127.0.0.1                                                                                                                              
 14 local_port = 2222                                                                                                                                 
 15 remote_port = 6001                                                                                                                                
 16                                                                                                                                                   
 17 [mosh_ubuntu_pc]                                                                                                                                  
 18 type = udp                                                                                                                                        
 19 local_ip = 127.0.0.1                                                                                                                              
 20 local_port = 60001                                                                                                                                
 21 remote_port = 6002                                                                                                                                
 22                                                                                                                                                   
 23 [rdp_win_pc]                                                                                                                                      
 24 type = tcp                                                                                                                                        
 25 local_ip = 127.0.0.1                                                                                                                              
 26 local_port = 3389                                                                                                                                 
 27 remote_port = 7001

Steps to reproduce the issue:

  1. I use IOS App (Blink shell) to connect my pc. And I have an aliyun server which has an public IP. I opened TCP ports for ssh connections and UDP ports for mosh connections. I run frps on aliyun server, and I run frpc on my windows pc (I don’t run frpc on my WSL).
  2. When I connect my pc (windows) by ssh, there’s no problem.
  3. When I connect my WSL (Ubuntu) by ssh or mosh, Blink shell return me follows:
blink> ssh my_ubuntu_pc
Socket error: disconnected

blink> mosh my_ubuntu_pc
Socket error: disconnected
Did not find remote IP address

Describe the results you received:

blink> ssh my_ubuntu_pc
Socket error: disconnected

blink> mosh my_ubuntu_pc
Socket error: disconnected
Did not find remote IP address

Describe the results you expected:
I just want to connect my WSL (Ubuntu) in my iPad Pro by Blink shell.

Additional information you deem important (e.g. issue happens only occasionally):
I don’t think its about ssh-key’s problem, and I can use Blink shell to ssh or mosh to my WSL when my iPad Pro and my PC in a same WiFi environment.

Can you point out what caused this issue (optional)
Do I have to run frpc in my WSL (Ubuntu) ?

Originally created by @jiaoruohong on GitHub (Sep 11, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1436 **What version of frp are you using (./frpc -v or ./frps -v)?** frp_0.29.0_windows_amd64 **What operating system and processor architecture are you using (`go env`)?** Windows 64 **Configures you used:** ``` 1 [common] 2 server_addr = myserver.xyz 3 server_port = 7000 4 5 [ssh_win_pc] 6 type = tcp 7 local_ip = 127.0.0.1 8 local_port = 22 9 remote_port = 6000 10 11 [ssh_ubuntu_pc] 12 type = tcp 13 local_ip = 127.0.0.1 14 local_port = 2222 15 remote_port = 6001 16 17 [mosh_ubuntu_pc] 18 type = udp 19 local_ip = 127.0.0.1 20 local_port = 60001 21 remote_port = 6002 22 23 [rdp_win_pc] 24 type = tcp 25 local_ip = 127.0.0.1 26 local_port = 3389 27 remote_port = 7001 ``` **Steps to reproduce the issue:** 1. I use IOS App (Blink shell) to connect my pc. And I have an aliyun server which has an public IP. I opened TCP ports for ssh connections and UDP ports for mosh connections. I run frps on aliyun server, and I run frpc on my windows pc (I don’t run frpc on my WSL). 2. When I connect my pc (windows) by ssh, there’s no problem. 3. When I connect my WSL (Ubuntu) by ssh or mosh, Blink shell return me follows: ``` blink> ssh my_ubuntu_pc Socket error: disconnected blink> mosh my_ubuntu_pc Socket error: disconnected Did not find remote IP address ``` **Describe the results you received:** ``` blink> ssh my_ubuntu_pc Socket error: disconnected blink> mosh my_ubuntu_pc Socket error: disconnected Did not find remote IP address ``` **Describe the results you expected:** I just want to connect my WSL (Ubuntu) in my iPad Pro by Blink shell. **Additional information you deem important (e.g. issue happens only occasionally):** I don’t think its about ssh-key’s problem, and I can use Blink shell to ssh or mosh to my WSL when my iPad Pro and my PC in a same WiFi environment. **Can you point out what caused this issue (optional)** Do I have to run frpc in my WSL (Ubuntu) ?
gitea-mirror 2026-05-05 12:43:31 -06:00
Author
Owner

@jiaoruohong commented on GitHub (Sep 12, 2019):

After rebootting my PC, restarting sshd and mosh-server, now I can ssh to my WSL. But I still can't mosh to my WSL,

mosh did not make a successful connection to x.x.x.x:6002
Please verify that UDP port 6002 is not firewalled and can reach the server.

(By default, mosh uses a UDP port between 60000 and 61000. The -p option selects a specific UDP port number.

Mosh session finished!
<!-- gh-comment-id:530662118 --> @jiaoruohong commented on GitHub (Sep 12, 2019): After rebootting my PC, restarting sshd and mosh-server, now I can ssh to my WSL. But I still can't mosh to my WSL, ``` mosh did not make a successful connection to x.x.x.x:6002 Please verify that UDP port 6002 is not firewalled and can reach the server. (By default, mosh uses a UDP port between 60000 and 61000. The -p option selects a specific UDP port number. Mosh session finished! ```
Author
Owner

@fatedier commented on GitHub (Nov 29, 2019):

Check if the frps is listening on udp port 6002.

<!-- gh-comment-id:559644463 --> @fatedier commented on GitHub (Nov 29, 2019): Check if the frps is listening on udp port 6002.
Author
Owner

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

Just an idea, try changing [mosh_ubuntu_pc] remote port from 6002 to 60001, matching the local port.

Before this change, I had same error as jiaoruohong, where mosh timed out after 60s,
mosh --ssh='ssh -p 6001' --server='mosh-server new -p 60001 -l LANG=en_US.UTF-8' -p 6002 foo_user@myserver.xyz

After changing remote port to 60001, I can mosh to my machine.
mosh --ssh='ssh -p 6001' --server='mosh-server new -l LANG=en_US.UTF-8' -p 60001 foo_user@myserver.xyz

My guess is mosh command ignores the server port (60001) whenever there is a -p option (6002).

  • https://linux.die.net/man/1/mosh says for -p flag "[mosh] uses a particular server-side UDP port" and it could imply that the remote and local ports must match.
  • Mosh works if I start the mosh-server manually (mosh-server new -p 60001 -l LANG=en_US.UTF-8) and connect to slave machine with secret key over 6002.
  • It has nothing to do with firewall or UDP failed to connect. I could successfully connect to the machine with nc commands (nc -4ulv 60001 on slave machine, nc -zvu myserver.xyz 6002 on mosh client machine). So most likely, this is something with mosh, not frp.

My setup:

  • frp: 0.30.0, Ubuntu 18.04
  • mosh: 1.3.2
  • cygwin: 10.0, Windows
<!-- gh-comment-id:568303042 --> @zhaoruibing commented on GitHub (Dec 22, 2019): Just an idea, try changing [mosh_ubuntu_pc] remote port from 6002 to 60001, matching the local port. Before this change, I had same error as __jiaoruohong__, where mosh timed out after 60s, `mosh --ssh='ssh -p 6001' --server='mosh-server new -p 60001 -l LANG=en_US.UTF-8' -p 6002 foo_user@myserver.xyz` After changing remote port to 60001, I can mosh to my machine. `mosh --ssh='ssh -p 6001' --server='mosh-server new -l LANG=en_US.UTF-8' -p 60001 foo_user@myserver.xyz` My guess is mosh command ignores the server port (60001) whenever there is a -p option (6002). - <https://linux.die.net/man/1/mosh> says for _-p_ flag "_[mosh] uses a particular server-side UDP port_" and it could imply that the remote and local ports must match. - Mosh works if I start the mosh-server manually (`mosh-server new -p 60001 -l LANG=en_US.UTF-8`) and connect to slave machine with secret key over 6002. - It has nothing to do with firewall or UDP failed to connect. I could successfully connect to the machine with nc commands (`nc -4ulv 60001` on slave machine, `nc -zvu myserver.xyz 6002` on mosh client machine). So most likely, this is something with mosh, not frp. My setup: - frp: 0.30.0, Ubuntu 18.04 - mosh: 1.3.2 - cygwin: 10.0, Windows
Author
Owner

@dongyuwei commented on GitHub (Sep 21, 2024):

我在 https://v2ex.com/t/395885?p=1#r_15289173 提供了比较完整的 mosh over frp 配置。

<!-- gh-comment-id:2364923796 --> @dongyuwei commented on GitHub (Sep 21, 2024): 我在 https://v2ex.com/t/395885?p=1#r_15289173 提供了比较完整的 mosh over frp 配置。
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#1129
No description provided.