Mailing List Archive

changing passwords on cat5 devices
Greetings,

In trying to change the enable password on about 100 CatOS devices, I have a
bourn shell script calling

clogin -c "set enablepass $2$UTXb$gcYEfPcOCt0Ths6szOXc0" $hostname

However, no matter how I quote the encrypted password and/or escape meta
character $, clogin either fails or executes with an empty password. Using
"clogin -x <filename>" produces the same effect.

Your pointers, please.

Anchi
changing passwords on cat5 devices [ In reply to ]
Mon, Jan 13, 2003 at 09:21:16AM -0600, Zhang, Anchi:
> Greetings,
>
> In trying to change the enable password on about 100 CatOS devices, I have a
> bourn shell script calling
>
> clogin -c "set enablepass $2$UTXb$gcYEfPcOCt0Ths6szOXc0" $hostname
>
> However, no matter how I quote the encrypted password and/or escape meta
> character $, clogin either fails or executes with an empty password. Using
> "clogin -x <filename>" produces the same effect.
>
> Your pointers, please.
>
> Anchi

$ identifies a variable in shell(s) and expect/tcl. if you single quote
the command, it will be protected from shell expansion. and, without
try it myself, expect may double-eval the command resulting in variable
expansion which could be protected by escaping the $s, as in \$.

clogin -c 'set enablepass \$2\$UTXb\$gcYEfPcOCt0Ths6szOXc0' $hostname

try this with caution. you should have an enable'd login in another
window.
changing passwords on cat5 devices [ In reply to ]
That works beautifully. Many thanks.

How would you rely on Rancid to add the following to IOS devices?

banner motd ^
************************************************************************

THIS IS A PRIVATE COMPUTING SYSTEM, RESTRICTED TO AUTHORIZED USERS ONLY.
IF YOU DO NOT HAVE AUTHORIZATION, YOU ARE WARNED TO DISCONNECT AT ONCE.

************************************************************************^
changing passwords on cat5 devices [ In reply to ]
On Mon, Jan 13, 2003 at 02:30:51PM -0600, Zhang, Anchi wrote:
> How would you rely on Rancid to add the following to IOS devices?
>
> banner motd ^
> ************************************************************************
>
> THIS IS A PRIVATE COMPUTING SYSTEM, RESTRICTED TO AUTHORIZED USERS ONLY.
> IF YOU DO NOT HAVE AUTHORIZATION, YOU ARE WARNED TO DISCONNECT AT ONCE.
>
> ************************************************************************^

Stick it into a file on your tftp server & use a modification of
util/cisco-load.exp to load it.
--asp