[rancid] Scripting clogin with bash and username/password

Per-Olof Olsson peo at chalmers.se
Thu Feb 13 16:06:31 UTC 2014


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
----------------------------------------------------------


More information about the Rancid-discuss mailing list