From: Matt Z. <mzagrabe@d.umn.edu> - 2015-03-26 20:03:58
|
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 |