<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>How about approaching this from a different direction? Instead of specifying the username and password on the command line, you specify an alternate cloginrc file, using the –f option? The alternate cloginrc file could have different user names and passwords.</div>
<div><br>
</div>
<div>Skye.</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Andrew Ohnstad <<a href="mailto:andrew.ohnstad@gmail.com">andrew.ohnstad@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, February 13, 2014 9:19 AM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:rancid-discuss@shrubbery.net">rancid-discuss@shrubbery.net</a>" <<a href="mailto:rancid-discuss@shrubbery.net">rancid-discuss@shrubbery.net</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [rancid] Scripting clogin with bash and username/password<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>I was hopeful about this, as it sounded good, but no luck.  Adding the -- option didn't help, and even su'ing into an interactive shell for the rancid user and running the command without the sudo didn't help.<br>
<br>
</div>
Thanks for the suggestion, though!<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Feb 13, 2014 at 11:06 AM, Per-Olof Olsson <span dir="ltr">
<<a href="mailto:peo@chalmers.se" target="_blank">peo@chalmers.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
heasley wrote 2014-02-13 16:40:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">Thu, Feb 13, 2014 at 10:22:11AM -0500, Andrew Ohnstad:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the response.  The full command line I am using is (I<br>
automatically am enabled via TACACS+):<br>
<br>
sudo -u rancid /usr/libexec/rancid/clogin -u<my-username> -p<my-password><br>
-c where <router><br>
<br>
If I add the -d argument to see the expect debugging, I can see that it<br>
launches the ssh spawn with the correct username, but it is blatantly<br>
disregarding the password supplied on the command line...<br>
<br>
spawn ssh -c 3des -x -l <myusername> <router><br>
</blockquote>
<br>
this should work; what version of rancid?<br>
</div>
</div>
<div class="">______________________________<u></u>_________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net" target="_blank">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" target="_blank">http://www.shrubbery.net/<u></u>mailman/listinfo/rancid-<u></u>discuss</a><br>
<br>
</div>
</blockquote>
<br>
sudo -l[l] [-AknS] [-g group name | #gid] [-p prompt] [-U user name] [-u user name | #uid] [command]<br>
is sudo using -p option for it's on to set a prompt? -u for own username...<br>
<br>
test<br>
  "sudo -u rancid -- /usr/libexec/rancid/clogin -u<my-username> -p<my-password> -c where <router>"<br>
<br>
>From sudo man page<br>
...<br>
    --          The -- option indicates that sudo should stop processing command line arguments.<br>
...<br>
<br>
Have seen this before to ssh/telnet commands<br>
<br>
<br>
/Peo<br>
------------------------------<u></u>----------------------------<br>
Per-Olof Olsson               Email: <a href="mailto:peo@chalmers.se" target="_blank">
peo@chalmers.se</a><br>
Chalmers tekniska högskola    IT-service<br>
Arvid Hedvalls backe 6        412 96 Göteborg<br>
Tel: 031/772 6738  Fax: 031/772 8680<br>
------------------------------<u></u>----------------------------<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</span>
</body>
</html>