-1

I have set up ssh between 2 Windows 7 PCs using openSSH in cygwin. RSA authentication is tested and working, so I can ssh into the host from the client without issue.

I then set up a tunnel on the client using:

"ssh -f -N -L localhost:24800:user@host:24800 user@host".

Ideally I would like to run a program called Synergy (which connects on port 24800) with destination "localhost" or 127.0.0.1 as the server address and port 24800, synergy times out, and my cygwin terminal displays "Write failed: Broken pipe". This results in the tunnel being closed.

Not sure if this is valid, but if I try:

$ ssh -vv -p 24800 localhost

I get the following error:

"OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012 
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0 
debug1: Connecting to localhost [::1] port 24800.
debug1: Connection established.
debug1: identity file /home/PeterLaptop/.ssh/id_rsa type 1
debug1: identity file /home/PeterLaptop/.ssh/id_rsa-cert type -1
debug1: identity file /home/PeterLaptop/.ssh/id_dsa type -1
debug1: identity file /home/PeterLaptop/.ssh/id_dsa-cert type -1
debug1: identity file /home/PeterLaptop/.ssh/id_ecdsa type -1
debug1: identity file /home/PeterLaptop/.ssh/id_ecdsa-cert type -1
Write failed: Broken pipe
ssh_exchange_identification: Connection closed by remote host"

Apologies if you're not familiar with synergy, but it's just a program that shares mouse&keyboard control between computers, and I'm fairly certain that synergy is not the problem. Can anybody tell me what I need to do to fix this?

EDIT: Following Joachim's advice, I ran:

ssh -f -N -L 24800:address:24800 user@address

This temporarily fixed the issue. However after I disconnected, and then tried to reconnect, the problem re-occured.

To give more information, I tried again with debugging to give the following:

$ ./synergyc.exe localhost
INFO: Synergy 1.4.10 Client on Microsoft Windows 7 x64
NOTE: started client
NOTE: connecting to 'localhost': 127.0.0.1:24800
debug1: Connection to port 24800 forwarding to 155.198.108.119 port 24800 requested.
debug2: fd 6 setting TCP_NODELAY
debug3: fd 6 is O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 2: new [direct-tcpip]
WARNING: failed to connect to server: Timed out
NOTE: connecting to 'localhost': 127.0.0.1:24800
debug1: Connection to port 24800 forwarding to 155.198.108.119 port 24800 requested.
debug2: fd 7 setting TCP_NODELAY
debug3: fd 7 is O_NONBLOCK
debug3: fd 7 is O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
WARNING: failed to connect to server: Timed out
NOTE: connecting to 'localhost': 127.0.0.1:24800
debug1: Connection to port 24800 forwarding to 155.198.108.119 port 24800 requested.
debug2: fd 8 setting TCP_NODELAY
debug3: fd 8 is O_NONBLOCK
debug3: fd 8 is O_NONBLOCK
debug1: channel 4: new [direct-tcpip]
Write failed: Broken pipe
NOTE: disconnected from server
NOTE: connecting to 'localhost': 127.0.0.1:24800
WARNING: failed to connect to server: Connection was refused

Unfortunately I still get this "Write failed: Broken pipe" error.

0

2 Answers 2

0

The correct syntax for the forwarding command is;

ssh -f -N -L 24800:address:24800 user@address

Note the removed localhost at the start (it's optional) and the lack of username in the mid parameter (it should be only the hostname)

The command will forward connections to port 24800 on localhost to the remote host's port 24800.

3
  • Thank you very much Joachim. How can I mark this as solved? Nov 30, 2012 at 13:55
  • @user1860856 As I remember it, there should be a dimmed out checkbox beside my answer that you can check :) Nov 30, 2012 at 14:04
  • Unfortunately the problem has re-occured. As far a I know, nothing has changed. I've edited the original post to contain more information Nov 30, 2012 at 17:24
0

Managed to Solve the problem by creating a batch file:

start C:\cygwin\bin\bash --login -i -c "ssh -N -L 24800:host:24800 user@host && C:/PROGRA~1/Synergy/synergyc -f localhost"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .