Unsolved

This post is more than 5 years old

17 Posts

1480

February 16th, 2009 09:00

switch script for mcdata switches ds4700M and ds32m2 using putty or plink

I have used plink in the past to telnet to brocade switches, issue commands and write the output to a text file.

I am struggling to so the same with mcdata switches as the telnet session does not appear to accept a clear password. I have tried using SSH but it ignores the supplied password and prompts for it. I presume I need to use a private key but not sure how to do this.

Any ideas?

9 Legend

 • 

20.4K Posts

February 16th, 2009 10:00

can you telnet from putty ?

2 Intern

 • 

1.3K Posts

February 16th, 2009 11:00

i gues you may have a access list at the switch side then..I have seen such ssh allow lists at NetApp filers

17 Posts

February 17th, 2009 01:00

yes I can telnet or ssh into the switch manually and issue cli commands.

telnet does not appear to accept the -pw option on plink for a password. It looks like ssh should accept a password but it keeps prompting for one.

I think possibly I need to set up a pvt key but I'm not sure how. I can display the switch public key info and I can create a public & pvt key using PuttyGen but thats as far as I have got so far.

9 Legend

 • 

20.4K Posts

February 17th, 2009 03:00

i am going to try on mine ..i have 4700 and 32 here.

9 Legend

 • 

20.4K Posts

February 17th, 2009 04:00

it looks like plink will not take -pw and -l option when using telnet, only ssh. You could do what you are trying to do from a perl script ..using "Net::Telnet" module.

17 Posts

February 17th, 2009 08:00

I tried tuning on SSH for one of the switches as the syntax looks like ssh should accept -l and -pw for a password but it kept asking for a password each time.
I cant do perl but I have come up with a couple of workarounds neither of which are as slick as plink which runs in the back ground, these open sessions in the foreground which is what I wanted to avoid.

First option was to use putty with presaved profiles containing the ipaddress and logging info.

the other option is to use telnet with the -f flag which write the output to a file. Got confused initially as I'm using telnet on a Win2000 machine which doesnt have the -f flag. Once I copied a version of the telnet client from win XP it worked.

Would still be interested in know if there is a way to telnet or ssh onto a mcdata switch without a password prompt. I did try reseting the SSH keys on the switch at which point i was reprompted to update my key on my pc so I think I have the correct key relationship.

9 Legend

 • 

20.4K Posts

February 17th, 2009 10:00

i should have thought about this before :) . I use TeraTerm with LogmeTT to connect to my Unix boxes, switches etc. I am too lazy to type my username and password all the time so i pre-created a few macros within LogmeTT that automates logins for me. I run it interactively while i am logged-in to my pc but i believe this can be scripted and run in unattended mode. Check it out

http://logmett.com/index.php?/Products/LogMeTT.html

a while back i had to automate a couple of windows apps installs and used autoit to do that. Check it out as well

http://www.autoitscript.com/autoit3/index.shtml

17 Posts

February 18th, 2009 03:00

Thanks dynamox - I'll take a look at the windows one.
No Events found!

Top