6

I am trying to debug a remote application. I have initiated a SOCKS proxy on server: ssh -D 9999 hostname

I then try to connect to it from my eclipse debug setting where hostname is the same and port=9999.

However I get error: channel 3: open failed: connect failed: Connection refused

I have also update eclipse network connections to allow SOCKS proxy. The configuration works on a different host name in the same network.

I am not able to interpret this error message. Can someone please assist where I am going wrong? I looked at this: SSH -L connection successful, but localhost port forwarding not working "channel 3: open failed: connect failed: Connection refused" but did find it useful in my case.

I have initiated my process on remote server in debug mode listening a specific port 4111 I confirmed that debug port is open by netstat -a command

Thank-you

Community
  • 1
  • 1
alwaysAStudent
  • 2,110
  • 4
  • 24
  • 47
  • Where is the code? Are you running the ssh process from the command line or from your Java code? Where do you see the error message? What do you mean by _"connect to it from my eclipse debug setting "_? Are you trying to run a remote debug session across ssh? I don't believe you can run a remote debug across SOCKS (but I could be wrong). – Jim Garrison Jan 29 '16 at 00:13
  • You should probably be using `-L` to set up direct port forwarding, don't rely on SOCKS proxying. – Jim Garrison Jan 29 '16 at 00:16
  • I am running ssh process from command line. When I execute the debug mode in eclipse, I see the error message on the remote host command line. In eclipse, I get the below error: `Failed to connect to remote VM Malformed reply from SOCKS server` I have checked if I am accessing the correct port in all cases as was suggested on some places on the internet – alwaysAStudent Jan 29 '16 at 00:40

1 Answers1

7

Rather than relying on SOCKS proxying, use

ssh -L4111:localhost:4111 server

To establish a direct connection across the ssh tunnel.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
  • Hi Jim, is server is the one you are trying to reach. I have to tunnel through two different channels. ssh -L 7777:localhost:7777 server1 ssh -L 7777:localhost:7777 -N server2. I am getting the same error. Any one please help me on this? – hemanta Nov 12 '20 at 01:42