automating username/password when ssh to cisco router

automating username/password when ssh to cisco router

NewsGroups | Search | Tools
 comp.dcom.sys.cisco  Post an article  get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content  add this group's latest topics to your Google content  YahooMyWeb Yahoo!  Google Google  Windows Live Favorites Windows Live  del.icio.us del.icio.us  digg digg  Add to Netscape Netscape
Subject Author Date
automating username/password when ssh to cisco router BertieBigBollox@gmail.com 04-16-2008
Posted by BertieBigBollox@gmail.com on April 16, 2008, 8:12 am
If you were  Registered and logged in, you could reply and use other advanced thread options
Trying to ssh from a Sun Solaris box to a Cisco router and want to use
a script to log in automatically without it prompting for a username
and password.

Looks like you can use ssh -l <username> to specify a username but
there doesnt appear to be a way to send the password, so it still
prompts for this.

I understand that if I was ssh to another unix box I could probably
use the 'expects' command and do it this way but I guess its no good
for a cisco router.

At the moment, I've got a file, called commands.txt which contains the
cisco commands. Then my Solaris script runs a command as follows:-

ssh -l user < commands.txt

So basically, once logged in the cisco commands are run automatically.
However, the password is the problem.

Anyone know of any way around this?

NMFall 20%
Posted by Gary Mills on April 16, 2008, 8:17 am
If you were  Registered and logged in, you could reply and use other advanced thread options

>Trying to ssh from a Sun Solaris box to a Cisco router and want to use
>a script to log in automatically without it prompting for a username
>and password.

I use `kermit' for this purpose. All of the scripting, including the
ssh password, can be done within a kermit script.


--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

Posted by BertieBigBollox@gmail.com on April 17, 2008, 5:10 am
If you were  Registered and logged in, you could reply and use other advanced thread options
>
> >Trying to ssh from a Sun Solaris box to a Cisco router and want to use
> >a script to log in automatically without it prompting for a username
> >and password.
>
> I use `kermit' for this purpose. =A0All of the scripting, including the
> ssh password, can be done within a kermit script.
>
> --
> -Gary Mills- =A0 =A0-Unix Support- =A0 =A0-U of M Academic Computing and N=
etworking-

Please correct me I'm wrong but with kermit dont you need a client end
and a server?

Client end (Solaris) would be OK but not sure how'd I'd run a kermit
server on the Cisco router? Of course, if you are able to do this, I'd
be grateful if you dont mind sharing....

Posted by Doug McIntyre on April 16, 2008, 9:21 am
If you were  Registered and logged in, you could reply and use other advanced thread options
>Trying to ssh from a Sun Solaris box to a Cisco router and want to use
>a script to log in automatically without it prompting for a username
>and password.

>Looks like you can use ssh -l <username> to specify a username but
>there doesnt appear to be a way to send the password, so it still
>prompts for this.

>I understand that if I was ssh to another unix box I could probably
>use the 'expects' command and do it this way but I guess its no good
>for a cisco router.

(expect, not expects)
Why not? Same exact thing.

Anyway, the tool has already been invented. The easiest thing to do
would probably go get the RANCID package and use the clogin script within.

Otherwise, the cosi-nms.sf.net area has many tools as well for remote access.


Posted by BertieBigBollox@gmail.com on April 17, 2008, 4:51 am
If you were  Registered and logged in, you could reply and use other advanced thread options
> >Trying to ssh from a Sun Solaris box to a Cisco router and want to use
> >a script to log in automatically without it prompting for a username
> >and password.
> >Looks like you can use ssh -l <username> to specify a username but
> >there doesnt appear to be a way to send the password, so it still
> >prompts for this.
> >I understand that if I was ssh to another unix box I could probably
> >use the 'expects' command and do it this way but I guess its no good
> >for a cisco router.
>
> (expect, not expects)
> Why not? Same exact thing.
>

OK. I just thought that since I was running ssh, control wouldnt
return to the script running this (and thus go on to the next line
with the expect statement on until the ssh command was all done and
complete?

Dont you need to use 'spawn' or something if doing it this way? Is
this right?

Similar ThreadsPosted
Automating switch/router config backups December 6, 2004, 5:57 am
Using Cisco EZVpn together with router-to-router IPSEC config August 21, 2006, 6:14 am
A non-Cisco router, BDCOM 1700 Router Series June 28, 2008, 4:27 am
Connecting Cisco 831 Router behind the D-Link Router March 25, 2007, 9:00 am
Cisco VPN Client 4.6.00.0049 to Cisco router 12.3.8T5, ACL's ? November 25, 2004, 1:07 pm
Difference b/n a Cisco Router and Cisco Switch January 5, 2005, 5:14 am
Upgrading the Cisco IOS on Cisco router 3640. July 27, 2007, 8:43 pm
Boot ROM chip required to upgrade both a Cisco 2610 and a Cisco 2620 router to support 32 megs+ flash and more than 64 megs RAM June 14, 2007, 10:57 am
cisco router February 18, 2005, 10:36 pm
Re: Cisco router again November 24, 2005, 9:25 pm

other useful resources:
The Federal Communications Commission (FCC)
Telecommunications Industry Association
Electronic and Software Security Products and Services
International Telecommunication Union

Custom CGI Perl and PHP programming by 1-Script.com

Contact Us | Privacy Policy
The site map in XML format XML site map