09-09-2005 07:10 AM - edited 02-21-2020 12:23 AM
Does someone know of or has created a script to login to a PIX and reload it without any intervention from the user? I can figure this out with Putty, but I was hoping to find a self contained script that any user can run from anywhere. The user would not know the commands used or the username/password. Any help would be great.
Thanks.
09-09-2005 07:10 PM
Hello John,
I have not configured that but the basic problem is that in the scipt itself the username and password would anyway be in clear text, which is a bad idea.
Anyway you could use Expect or Rancid in an Linux or Unix envoronment or Perl in windows of unix system.
Links:
http://www.shrubbery.net/rancid/
http://expect.nist.gov/#examples
http://www.perl.com/download.csp#binary
Hope that gets you one step further.
sincerely
Patrick
09-16-2005 12:09 AM
with perl and some change (the complete code i 'had done will use a web page) will be like:
$session->login($conf{LOGIN}, $conf{PASS});
die "Non sono riusciato ad aprire il telnet\n" if(! $session);
$ok = $session->enable(Password => $conf{ENAPASS}, Level => $conf{ENALEVEL});
if ( $ok eq 0)
{
print STDERR "Enable Failed\n";
}else{
# Execute a command
@output1 = $session->cmd('configure terminal');
@output2 = $session->cmd('controller e1 1/0');
@output3 = $session->cmd('loop');
sleep(3);
@output4 = $session->cmd('no loop');
@output5 = $session->cmd('end');
print "1> @output1
\n2> @output2
\n3> @output3
\n4> @output4
\n5> @output5
\n";
print STDERR "Warning !! loop no loop\n1> @output1\n2> @output2\n3> @output3\n4> @output4\n5> @output5\n";
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide