Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

managing IOS and CatOS switch

I have IOS using ssh V.2 and CatOS using SSH v.1 and I have perl cgi- ssh expect script to remote access those 2 switch. however, I am able to access the IOS switch but not the CatOs. anybody knows how can alter my script to handle both version or this not achievable.any help highly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: managing IOS and CatOS switch

"term len 0" is not valid for CatOS. The equivalent command is "set length 0".

8 REPLIES
Cisco Employee

Re: managing IOS and CatOS switch

As long as your SSH client supports both versions of the protocol, no changes to expect is required. OpenSSH supports both protocols.

Silver

Re: managing IOS and CatOS switch

just a wild guess on my part but when you ssh to the CatOS from the client where you initiate the perl-expect script, did you use something "spawn ssh -1 -l $username $remotehost". I have not used ssh on CatOS that much but I don't think CatOS support ssh version 2. Most unix ssh client default to version 2. That could be the issue.

Community Member

Re: managing IOS and CatOS switch

Thanks a lot for your response!I am using "spawn ssh -l $username $remotehost" not using force version -1 since the other switch using version 2.unfortunately all our CatOS using version 1.I have enabled both Version 1 and 2 on my unix server but still the expect script unable access the CatOS switch.

Community Member

Re: managing IOS and CatOS switch

my unix server enabled for both ssh Version 1 and version 2 but no luck so far, I have attached my expect script. if you guys see any error.thanks a lot

Cisco Employee

Re: managing IOS and CatOS switch

If you're using OpenSSH, protocol version 1 will print:

RSA1 key fingerprint ...

So you'll need to modify your regular expression:

expect {

-re "RSA1? key fingerprint" {send "yes\r"}

timeout {puts "RSA error -> $expect_out(buffer)";exit}

}

Of course, you didn't mention the specific error you're seeing, so it's impossible to know if this is the only problem (or a problem at all).

Community Member

Re: managing IOS and CatOS switch

thanks J. we are close too. after added as you suggested to expect RSA1" now the error I got is

"term len 0

Unknown command "term". Use 'help' for more info." so when add a comment on this line on my expect script

#expect {

-re "\[#>] ?$" {send "term len 0\r"}

timeout {puts "error reading prompt -> $expect_out(buffer)";exit}

}

my script able to access the switch but display only the the banner section when I run a script " as you know this CatOs display first the banner before going to device prompt. so it's hang on banner portion not going to actual switch123> (enable).

Thanks

Cisco Employee

Re: managing IOS and CatOS switch

"term len 0" is not valid for CatOS. The equivalent command is "set length 0".

Community Member

Re: managing IOS and CatOS switch

working perfectly.....thank you so very much!!!!!!

569
Views
0
Helpful
8
Replies
CreatePlease to create content