Vicente Esnaola
Vicente Esnaola

Reputation: 173

VNC viewer failing to make connection with "channel 3: open failed: connect failed: No route to host"

I ssh into a server with the following:

ssh -g -L5912:server:5912 user@host

It goes through, and I can access my files on the other server through the command line (meaning I can connect to the server, it is my vnc viewer that is failing!) but when I try to open my vnc viewer (RealVNC) and connect to localhost:12 i get the following error message in the vnc viewer application:

The connection closed unexpectedly.

Additionally in the original command line shell i get:

channel 3: open failed: connect failed: No route to host

I've tried switching to different ports and even checked out other posts on the same error message but the problem is i don't really understand them... ssh tunnels are still relatively new to me so i don't really know what im doing. Any help would be greatly appreciated. Thanks!

Upvotes: 2

Views: 16772

Answers (2)

Jarek
Jarek

Reputation: 930

You're trying to setup a port forwarding, this may fail because of many reasons:

  • SSH port forwarding not enabled in the host

Check SSH server in the host if AllowTcpForwarding is enabled:

$ grep AllowTcpForwarding /etc/ssh/sshd_config
AllowTcpForwarding yes

Typically, it's commented out. Uncomment and restart the sshd.

  • No connection between the host and server over port 5912

SSH to the host and try:

$ telnet server 5912
Connected to server.
Escape character is '^]'.
  • Finally, does the server listen on 5912?

Similarly, as above, but from the server - go there and try telnet server 5912.

Best regards, Jarek

Upvotes: 2

saygley
saygley

Reputation: 450

In my case it was the port forwarding rule I had set in Putty.

Please make sure you enter the correct hostname when defining the rule in Putty. I changed

localhost:5903

with

myserver:5903

and it worked...

Upvotes: 1

Related Questions