I am trying to write a quick script that will establish an ssh tunnel to a remote linux server that will let me run vncviewer on any machine behind that machine.
I have this ... system ( "ssh -g -C -L 5900:machinebehindserver:5900 remotelinuxserver" ); system ( "vncviewer localhost" );
of course this doesn't work because it tryes to run vncviewer localhost on the ssh server rather then on my box. The commands run from terminal work fine. I run the ssh command then i open another terminal and run the vncviewer. Everything is groovy :)
Change the above ssh command to:
ssh -N -f -g -C -L 5900:machinebehindserver:5900 remotelinuxserver
This will send ssh to the background after establishing the tunnel. Also, you don't need Perl for this. You can easily use a bash script which will have less overhead.
#!/usr/bin/bash
ssh -N -f -g -C -L 5900:machinebehindserver:5900 remotelinuxserver vncviewer localhost
-- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>