[rancid] Scripting clogin with bash and username/password

Daniel Schmidt daniel.schmidt at wyo.gov
Thu Feb 13 18:51:19 UTC 2014


Why not use tacacs accounting to log everything the user does, script or no
script?  Why not use ciscocmd, iosrun or some other pre-made free tool to
do this?  I've written little python snippets to do exactly this: ask a
user what he wants to do, ssh or telnet, what text file has his list, what
text file has your routers/commands/etc which I would share, but that they
were done in haste and look like they were coded by drunken monkeys.  I'd
be happy to give pointers though.


On Thu, Feb 13, 2014 at 9: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
> ----------------------------------------------------------
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>


E-Mail to and from me, in connection with the transaction 
of public business, is subject to the Wyoming Public Records 
Act and may be disclosed to third parties.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20140213/a5ed6aac/attachment.html>


More information about the Rancid-discuss mailing list