Red Hat Bugzilla – Bug 489629
Connection to VNC server tunneled over ssh refused in some circumstances
Last modified: 2009-03-11 07:59:07 EDT
Description of problem:
On a machine, let's call it VirtHost, I start a guest OS instance running under kvm. On VirtHost I can start a VNC viewer (I'll use vinagre throughout) and can connect to my guest OS as expected on port 5900.
Now I move to a different machine (let's call it RemoteHost) and issue the command:
ssh -L 6900:localhost:5900 VirtHost
and now I can run a VNC viewer on RemoteHost connecting to localhost::6900 in order to access the guest running on VirtHost via VNC. All well and good and working as expected.
However, now on VirtHost if I instead have these lines in my .ssh/config file:
LocalForward localhost:6900 VirtHost:5900
and then ssh in to VirtHost I find I cannot connect localhost::6900 in order to connect to the guest OS, and in the ssh session I see:
channel 3: open failed: connect failed: Connection refused
This did work on F-9.
I'm not sure if this is a kvm or libvirt of openssh problem. Reporting against kvm initially.
Version-Release number of selected component (if applicable):
openssh-5.1p1-3.fc10.x86_64 (on both machines)
Works just fine for me - I think you have your .ssh/config on the wrong host - it needs to be configured on the host you're ssh'ing from, not to. In any case this isn't a KVM or libvirt bug, since neither care about ssh forwarding.
Yes, sorry, the line in my bug report that read:
"However, now on VirtHost if I instead have these lines in my .ssh/config file:"
should have read:
"However, now on RemoteHost if I instead have these lines in my .ssh/config file:"
I have however tracked down the problem - it's a "feature" of the present version of openssh - it all works as expected if I replace the hostnames in the config file with IPV4 hostnames, otherwise openssh tries IPV6 ones.
Sorry for the noise.