[CentOS] vncviewer via gateway option question

Robert Moskowitz rgm at htt-consult.com
Tue Jul 15 14:36:46 UTC 2008

Jim Perrin wrote:
> On Mon, Jul 14, 2008 at 9:18 PM, Robert Moskowitz <rgm at htt-consult.com> wrote:
>> How do I set up this environment variable on my notebook.  Would I modify my
>> .bash_profile file, and is the format of the added line:\
>> VNC_VIA_CMD=/usr/bin/ssh -p 7722 -f -L "$L":"$H":"$R" "$G" sleep 20
> You could actually do this a little bit easier, by defining a user ssh
> config file in ~/.ssh
> You could do something similar to:
> Host myvncgateway
> HostName server.com
> User backupuser #default username
> Port 2222 # Use this port instead of 22.
neat, but...

This simplified my ssh commands, not having to include the -p ____

But I could not get vncviewer working. For the command:

vncviewer gate.foo.com:5902 -via gate.foo.com

I get:

VNC Viewer Free Edition 4.1.2 for X - built Mar 14 2007 22:51:02
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
me at gate.foo.com's password:

Tue Jul 15 07:54:27 2008
CConn: connected to host localhost port 5599
channel 3: open failed: connect failed: Connection refused
main: End of stream

Where did port 5599 come from?

So I kind of gave up, I set up a SSH port forwarding and ran through that.

All this to make a change to my firewall rules. My firewall would not 
accept an external admin connection, so I had to get an internal Firefox 
client running on this system. Hop, Hop, Hop....

More information about the CentOS mailing list