[TriLUG] a perl/expect/IOS question

Greg Brown gwbrown1 at gmail.com
Thu Feb 23 14:47:05 EST 2012


I have an encrypted tacacs key that I extract out of a router and I place
that key onto the line "tacacs-server key 7 $tacacsKey" using join.  The
actual line is my $configLine=join(' ',"tacacs-server key 7",$tacacsKey);

 I can copy and past that line manually into the cisco router and the
router accepts the key.  If my script tries to do the same I get an invalid
key error.

I think I might have a control character stuck in there but I'm starting to
doubt it.  I can 'od -c' the string and it looks ok but the key will fail
within the script ever time throwing back "%Invalid encrypted key" every
time.

So, in summary, cut and past the line by hand with the encrypted key and
the router accepts it.  Try the same using Net::SSH::Expect and it fails.

Ideas?  I don't have any at this point.

Greg



More information about the TriLUG mailing list