changing passwords on cat5 devices

john heasley heas at shrubbery.net
Mon Jan 13 19:19:19 UTC 2003


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.



More information about the Rancid-discuss mailing list