<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt">So, I’ve been modifying my switch/router configurations with RANCID for many years now. This is the first time I’ve bumped into this one. At first look, this probably seems like a Cisco issue, but I think
not. Well, maybe partially… The same command issued in the Cisco CLI works fine. It’s only when I issue it via RANCID that I have a problem. The problem could also lie in the bash shell, which might be reacting to the periods and other meta characters
in the encrypted string. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">I’m trying to issue via “clogin –c” a set enable secret command (among others) using a predefined encrypted key. So, my command ends up something like this. (The encrypted value is bogus, but similarly
constructed.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">for host in “list of switch IP addresses”; do clogin -c "config t;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">enable secret 5 $8$VNEb$ait.ADc45ru5cDNQEGa/.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">no username Bob.Smith;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">no ip http authentication local;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">ip http authentication aaa login-authentication local+radius;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">ip http authentication aaa exec-authorization local+radius;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">end; write memory;" $host > /tmp/$host.log & done<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">The Cisco CLI barks at the encrypted string and the rest of the commands work as expected.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Hostname(config)#enable secret 5 .ADc45ru5cDNQEGa/.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">ERROR: The secret you entered is not a valid encrypted secret.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">To enter an UNENCRYPTED secret, do not specify type 5 encryption.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">When you properly enter an UNENCRYPTED secret, it will be encrypted.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">As I write this, I suspect it’s the bash shell that’s mangling things. Any thoughts?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Chris<o:p></o:p></span></p>
</div>
</body>
</html>