From: MAGANA, A. S I C. U. A. 72 ABW/S. <and...@us...> - 2015-03-26 20:35:15
|
I have debugging set to $ssh->debug(1) also I am pointing this script to execute on a solaris 10 server. Below are my results. $ Closing spawn id(3). at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 1431 Expect::hard_close('Expect=GLOB(0xd552470)') called at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 1621 Expect::DESTROY('Expect=GLOB(0xd552470)') called at tester-b line 0 eval {...} called at tester-b line 0 spawn id(3) closed. Pid 32508 of spawn id(3) terminated, Status: 0xFF00 //SIGNED// Andy Magaña UNIX Systems Administrator Diligent Contractor, 72nd Air Base Wing Tinker Air Force Base, Oklahoma Commercial: (405) 734-0341 -----Original Message----- From: Matt Zagrabelny [mailto:mzagrabe@d.umn.edu] Sent: Thursday, March 26, 2015 3:04 PM To: MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT Cc: exp...@li... Subject: Re: [Expectperl-discuss] expect.pm script On Thu, Mar 26, 2015 at 2:12 PM, MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT <and...@us...> wrote: > Need help with trying to create a expect.pm script so that I can > change passwords on my Solaris-10 and 9 servers. I am using this > expect.pm script from my Linux server I also have Net::OpenSSH but I am not using right now. > Any examples would help. > > #!/usr/bin/perl > use strict; > use Expect; > > my $ssh = Expect->new('ssh user@host'); #$ssh->debug(1); > $ssh->expect(5, q{Password:}); $ssh->send("password\n"); > $ssh->expect(5, '$'); #$ssh->send("exit\n"); #$ssh->close(); > exp_continue; and what is the output? -m |