LogMeTT.com • Macro for SSH
Page 1 of 2

Macro for SSH

Posted: Mon May 14, 2007 3:37 pm
by thrdbseshwcase3
My question is i'm trying to run a .ttl with SSH. What i want this to do is login and do major changes to Enterasys Routers (over 400). I have made one for telnet but the code is not recognized when i use SSH. I want to have a pool of IP address and once it gets done with one router it goes to the next and the next and so on. here is my code for telnet. Please Help!!!


Posted: Mon May 14, 2007 3:54 pm
by boris
Check the following 2 threads to find the answers on your questions:


Posted: Mon May 14, 2007 4:07 pm
by thrdbseshwcase3
I tried that code and changed it to SSH and it still couldnt recognize it.

Posted: Mon May 14, 2007 4:17 pm
by boris
Could you please explain what do you exactly mean by "the code is not recognized" ?
Have you tried to enter all your commands "by hand" ? Did they work?

Paste here the output of your screen, that will give us better idea of what is the issue.

Posted: Mon May 14, 2007 4:28 pm
by thrdbseshwcase3

I am not sure what to connect to. Also i don't want to type in the username and password.

Posted: Mon May 14, 2007 4:41 pm
by boris
Your connect string does not look right to me. Let's take 1 step a time.

Create new macro and add the followig line:

Replace myserver with your server name or IP address. Replace username with actual username and password (at the end of the line) with actual password. Do not change /auth=password part of the string. Are you able to connect using this syntax ?

Posted: Mon May 14, 2007 4:51 pm
by thrdbseshwcase3
when i put an IP in there, from one of our routers i get an error says SSH2 autologin error. If i go to the main menu and type it it works. so something with the autologin is breaking the macro

Posted: Mon May 14, 2007 5:03 pm
by boris
When logging in interactive mode do you use plain password to log in (phassphrase), RSA/DSA key or challenge/response option?

Posted: Tue May 15, 2007 1:15 pm
by thrdbseshwcase3
I use plaintext. we have a standard word we use. i downloaded teraterm from http://ttssh2.sourceforge.jp/ where i click the icon on the bottom right corner and go to list configuration and i add some of our sites into and i put ssh and put the passphrase in it and then try and execute it it just has ssh on the screen.

Posted: Tue May 15, 2007 2:13 pm
by boris
click the icon on the bottom right corner

Are you talking about LogMeTT application?

Could you try to start ttermpro.exe from TeraTerm installation directory, then in New Connection window enter your IP address, select service SSH, select SSH version SSH2, make sure that TCP port is set to 22 and click Ok. Another window will show up where you will need to enter your username and password. Could you please do this "pure" test and let us know if it works.

Posted: Tue May 15, 2007 2:16 pm
by thrdbseshwcase3
The pure test works. When i add a new one i have to store the key and all the but once its in there it works fine. I was talking about the TeraTerm Menu on the bottom right corner.

Posted: Tue May 15, 2007 2:21 pm
by boris
TeraTerm Menu is old application that is not supported any more (as far as I know). You can do the same and much more using my LogMeTT tool. It is part of TeraTerm package. Check LogMeTT help file to learn about it.

Posted: Tue May 15, 2007 5:08 pm
by thrdbseshwcase3
Do you know why the autologin fails? And the version of tera term might not be any good now a days. Thanks,

Posted: Tue May 15, 2007 5:23 pm
by boris
Install the latest version 4.52 and try again http://logmett.com/freeware/TeraTerm/ ... f8_452.exe

Posted: Tue May 15, 2007 5:54 pm
by thrdbseshwcase3
Unfort. same thing. It looks like its working and then it says autologin fails. I can send you my script i have used for telnet and it works like a charm. Just can't get it to work for SSH because the autologin and i think the RSA Key needs to be in the ssh_known_hosts section before it can work with every IP correct me if i'm wrong

Posted: Wed May 16, 2007 1:25 pm
by boris
You need to ssh to each server in interactive mode at least once to accept the keys. After that your macro should work. Make sure that remote node accepts SSH (port 22 is listening) and you are using correct ssh mode (SSH1/SSH2)

Posted: Wed May 16, 2007 1:32 pm
by thrdbseshwcase3

Posted: Wed May 16, 2007 1:47 pm
by boris
Create new macro, add one line

then manually enter username and password in popup window and check if it will work.

Posted: Wed May 16, 2007 1:50 pm
by thrdbseshwcase3
That works when i type everything in manually but when i try for the autologin it fails. When i do it manually how do i get back to my script?

Posted: Wed May 16, 2007 1:54 pm
by boris
Does your password contain @ or space?

mportant note: The password can contain space character. To represent space inside the password replace it with @ character. If @ character itself is part of the password than it has to be replaced with 2 consecutive @ characters @@.

Posted: Wed May 16, 2007 4:24 pm
by thrdbseshwcase3
I do have a @ sign but when i try to put @@ where the @ sign is it still fails. I changed the password and took out the @ and it works!!!!!!!!

Posted: Wed May 16, 2007 4:33 pm
by boris
Yutraka, maya:

Could you please double check the code to make sure @ and space in passwords work as described in the Important note of this topic: http://logmett.com/forum/viewtopic.php?t=28

Posted: Wed May 16, 2007 4:37 pm
by thrdbseshwcase3
connect 'xxx.xxx.xxx.xxx:22 /ssh /auth=password /user=admin /passwd=Callaw@@y'

Correct syntax? If so this is the code that fails.

Posted: Wed May 16, 2007 5:00 pm
by boris
Looks correct to me. :?

Posted: Wed May 16, 2007 6:23 pm
by thrdbseshwcase3
Once i have connected to the router how am i able to send lines

connect 'xx.x.xx.xxx:22 /ssh /auth=password /user=xxx /passwd=xxxx'

sendln 'en'

Once im in the router i want to start sending command and i know the syntax is not correct i do not believe