Omgili, forum search, forums search, search forums, discussion search,discussions search, search discussions, board search, boards search, search boards
  Advanced Search

Can not make port forwarding from Cygwin when ControlMaster/ControlPath used.

On Mon, 13 Feb 2012 11:18:07 +0200, Oleksandr Gavenko <...@bifit.com.ua

I can forward port from Cygwin to Debian:

cygwin# nc -l -p 6000

debian1# ssh -L 7000:cygwin.host:6000 use...@cygwin.host

debian2# telnet localhost 7000

But if do same in inverse direction I got:

debian# nc -l -p 6000

cygwin1# ssh -L 8000:debian.host:6000 use...@debian.host

bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 8000
Could not request local forwarding.

I don't understand what this mean...

netstat under Cygwin is Windows utility:

debian# netstat -l -n | grep 6000
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN

cygwin2# netstat -n -a -n

TCP 127.0.0.1:8000 0.0.0.0:0 LISTENING 2308
[ssh.exe]

Note that ssh.exe is not "ssh -L" but that I run to connect to debian.host for
"nc -l -p 6000".

To resolve issue I comment this line in ~/.ssh/config:

# ControlPath ~/.ssh/sock_%r@%h_%p
# ControlMaster auto

--
Best regards!

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple



On Mon, 13 Feb 2012 14:53:13 +0100, Corinna Vinschen <...@cygwin.com

Works for me with or without these lines.

Corinna

--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple

On Mon, 13 Feb 2012 15:00:27 +0100, Corinna Vinschen <...@cygwin.com

Btw., connection sharing doesn't work on Cygwin. For this to work we
need descriptor passing over AF_LOCAL sockets, which isn't implemented
in Cygwin.

Corinna

--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple

On Mon, 13 Feb 2012 18:34:19 +0200, Oleksandr Gavenko <...@bifit.com.ua

OK, thanks for explanation.

As possible solution:

* comment above lines
* pass "-S none" to ssh

Note that ssh create files ~/.ssh/sock_%r@%h_%p so code partially work.

--
Best regards!

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple

On Mon, 13 Feb 2012 19:50:32 -0500, Charles Wilson <...@cwilson.fastmail.fm

Yes, please! (I know, I know, SHTDI).
http://cygwin.com/ml/cygwin/2009-10/msg00397.html
See Corinna's and cgf's comments downthread.

--
Chuck

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple

On Tue, 14 Feb 2012 09:53:18 +0100, Corinna Vinschen <...@cygwin.com

...and in contrast to what Dave replied even the DuplicateHandle part is
not trivial. It requires one of the processes to have PROCESS_DUP_HANDLE
rights for the other process. But since you're connected over a socket,
you don't know the process ID of your peer(*). And then, either one of
the processes is an admin process, or both processes belong to the same
user account, or one of the processes must know the SID of the peer
process and open up its process for PROCESS_DUP_HANDLE access to that
user account.

Corinna

(*) getpeereid only works for the listening/connecting processes, not for
forked child processes thereof.

--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple