[wplug] perl help

John Harrold jmh17 at pitt.edu
Sun Feb 15 11:44:46 EST 2004


Sometime in February Ryan W. Frenz assaulted the keyboard and produced:

| Sorry if this is an easy question -- I'm relatively new to perl.  I'm 
| trying to launch ssh from a perl script.  I can launch it fine, but I 
| need the user to be able to enter password when ssh prompts for it.  
| Right now, I'm just getting the prompt for password but then "permission 
| denied" instantly.  I guess I need perl to allow the user to enter the 
| password, then regain control after that.  Any ideas?  I hope the 
| question made sense.  I've attached the script...
| 
| Thanks,
| Ryan
| 
| # ! perl
| 
| $prog = $ARGV[0]
| $machine = $ARGV[1];
| $label = $ARGV[2];
| 
| `ssh $machine $prog`
| 
| open(FD, ">>file");
| print FD "ssh $machine $prog";


did you try the system command?

 my $prog    = $ARGV[0];
 my $machine = $ARGV[1];
 my $label   = $ARGV[2];
 my $cmd     = "ssh user\@$machine  $prog";
# or
    $cmd     = "ssh $machine  $prog";

    system($cmd);

    exit 0;

-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20040215/274e3176/attachment-0001.bin


More information about the wplug mailing list