in reply to Perl, SSH port forwarding, and secure VNC

You can do it without perl. Create an ssh publickey and copy it into remotehost's ~/.ssh/authorized_keys. This avoids using any password at all (and is actually more secure in some respects). then you can do:
ssh -L 5900:vnctarget:5900 remotehost
and then
vncviewer localhost
will get you VNC access to vnctarget. Just tested it.

davis
It wasn't easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.

Replies are listed 'Best First'.
Re^2: [OT] Perl, SSH port forwarding, and secure VNC
by johnnywang (Priest) on Feb 22, 2005 at 05:30 UTC
    just want to add that this also requires setting the sshd configuration to allow this, check the /etc/ssh/sshd_config, turn on: RSAAuthentication, PubkeyAuthentication
      Yes this is correct. I aparently already had that turned on for some other reason.
Re^2: [OT] Perl, SSH port forwarding, and secure VNC
by Aristotle (Chancellor) on Feb 23, 2005 at 11:17 UTC

    Note that if you connect to localhost, VNC will assume you have a fast link and will disable all compression. That can make things very slow if the remote host is not on a LAN with the local machine, in which case you'll have to supply the appropriate -encodings to get a semblance of speed.

    Note also that with TightVNC, you can avoid the ssh -L / -encodings dance by simply saying

    vncviewer -via remotehost vnctarget
    

    Makeshifts last the longest.

Re^2: [OT] Perl, SSH port forwarding, and secure VNC
by xorl (Deacon) on Feb 21, 2005 at 21:29 UTC
    Ah Cool. It does work! Thanks.