Phoenix.pm: open sesame

EdelSys Consulting edelsys at edelsys.com
Sat May 20 00:11:13 CDT 2000


At 08:15 PM 5/19/00 -0700, you wrote:
>Greetings:
>Hope everyone is doing well. 
>
>I'm looking to automate logging into a server and
>I wanted to see if I could do it with perl, meaning, use perl as a shell
>script. I don't plan on using this script as a CGI script! :) 
>but use it like any shell script, to automate tasks...
>
>I noticed this book won't be out till July:
>Perl for System Administration 
>by David N. Blank-Edelman, Linda Mui (Editor)  
>
>Here's what I've tried so far:
>----------the script:
>
>#!/usr/bin/perl-wT
>
>$ENV{"PATH"} = "";
>
>use strict;
>
>open(SSH, "| /usr/bin/ssh -c 3des -l username 127.0.0.1");
>print SSH "my_password";
>close(SSH);
>
>----------and what I get in response:
>
>[terminal]# perl s_download_db.cgi  (here I execute the script)
>
>Pseudo-terminal will not be allocated because stdin is not a terminal.
>username at 127.0.0.1's password: 
>
>------------
>
>I'm wondering how I could "give" SSH the password? 
>
>Thanks so much.
>
>-Pablo
>

Perl + Expect should do the trick.

Tony


--
--  Anthony R. Nemmer -- EdelSys Consulting
--  http://www.swlink.net/~edelsys -- edelsys at edelsys.com
--  ICQ #14638605 -- EFNet IRC Nicks: Teratogen PerlGod LLamaLord
--  vCard:  http://www.edelsys.com/nemmer.vcf
--  (480) 968-6438 --  P.O. Box 1883,  Tempe, Arizona 85280-1883
--

   Brian Wilson is God!  =)




More information about the Phoenix-pm mailing list