[rancid] Scripting clogin with bash and username/password

Andrew Ohnstad andrew.ohnstad at gmail.com
Thu Feb 13 17:19:03 UTC 2014


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.

Thanks for the suggestion, though!


On Thu, Feb 13, 2014 at 11:06 AM, Per-Olof Olsson <peo at chalmers.se> wrote:

> heasley wrote 2014-02-13 16:40:
>
>> Thu, Feb 13, 2014 at 10:22:11AM -0500, Andrew Ohnstad:
>>
>>> Thanks for the response.  The full command line I am using is (I
>>> automatically am enabled via TACACS+):
>>>
>>> sudo -u rancid /usr/libexec/rancid/clogin -u<my-username> -p<my-password>
>>> -c where <router>
>>>
>>> If I add the -d argument to see the expect debugging, I can see that it
>>> launches the ssh spawn with the correct username, but it is blatantly
>>> disregarding the password supplied on the command line...
>>>
>>> spawn ssh -c 3des -x -l <myusername> <router>
>>>
>>
>> this should work; what version of rancid?
>> _______________________________________________
>> Rancid-discuss mailing list
>> Rancid-discuss at shrubbery.net
>> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>>
>>
> sudo -l[l] [-AknS] [-g group name | #gid] [-p prompt] [-U user name] [-u
> user name | #uid] [command]
> is sudo using -p option for it's on to set a prompt? -u for own username...
>
> test
>   "sudo -u rancid -- /usr/libexec/rancid/clogin -u<my-username>
> -p<my-password> -c where <router>"
>
> From sudo man page
> ...
>     --          The -- option indicates that sudo should stop processing
> command line arguments.
> ...
>
> Have seen this before to ssh/telnet commands
>
>
> /Peo
> ----------------------------------------------------------
> Per-Olof Olsson               Email: peo at chalmers.se
> Chalmers tekniska högskola    IT-service
> Arvid Hedvalls backe 6        412 96 Göteborg
> Tel: 031/772 6738  Fax: 031/772 8680
> ----------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20140213/a9a81620/attachment.html>


More information about the Rancid-discuss mailing list