[Israel.pm] web-based script

Anatoly Vorobey mellon at pobox.com
Tue Aug 31 05:25:34 PDT 2004

You wrote on Tue, Aug 31, 2004 at 02:36:23PM +0300:
> >Call sftp from the shell script. Call ssh from the shell script with
> >another shell script name on the command line. That script resides on C
> >and has an ssh invocation with the name of another script on B. The
> >script on B does the sftp and chmod. Or you can combine it all in one
> >ungainly command line in the original script, I guess (if you get the
> >escaping right).
> I didn't understand this...
> Can you give an example?

ssh -A login1 at server1 ssh -A login2 at server2 ./script.sh

This logs you into server1 and then runs "ssh -A login2 at server2 ./script 
sh", which then logs you into server2 and then runs "./script.sh". 
script.sh resides on server2 and has the sftp and chmod commands you 

Run the ssh auth agent (man ssh-add) on the originating machine, and 
then -A will carry authentication forward through the chain. Or set up 
correct auth on all servers beforehand and skip the -As. 

As others wrote, there're more ways to do it; this one is merely the 
most simple-minded and easy to understand.

"There's nothing simply good, nor ill alone" -- John Donne

More information about the Perl mailing list