Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Softpanorama Search

Teraterm

News Telnet protocol Recommended Links Teraterm Macros Reference for macrolanguage LogMeTT TTPMenu
CygTerm+ Cygwin Expect SSH Password-less SSH login TTSSH Usage of SCP with Teraterm
GNU Screen Exceed HostExplorer Putty Telnet protocol Tips Humor Etc

Currently Teraterm is probably the best free/open source Telnet/SSH client for Windows environment.  It supports both Telnet and SSH (scp functionality is also supported via File/send file and File/SSH SCP menu items).

Teraterm  known by the abbreviation `TT' was created in 1994 in Japan. The original author of the Teraterm was Takashi Teranishi.  Teraterm was released as freeware and won "Online software grand prize 97" competition held by Japanese tool portal Madonomori in 1997. Takashi Teranishi stopped developing Teraterm in 1998. The latest official version created by him was version 2.3.

In September 2004 group of Teraterm enthusiasts from Japan was able to contact Takashi Teranishi, obtained the permissions to develop Teraterm further and to distribute it under BSD license. They launched the project at SourceForge.jp and released series of versions starting from 4.00.  Support forum was established in early 2005. It is the place where TeraTerm users can ask their questions, exchange ideas, share their experience working with the application, post new feature suggestions or report the bugs.  The current version of Teraterm is 4.62.

The product has non-intuitive configuration, but generally functionality is very good.  It provide history of visited sited out of the box and has ability to change the size of screen on the fly.  The package has the following features:

Notes:

What's really important is the teraterm has macro capabilities that enable automatic login to any conceivable  Unix or linux or Cisco boxes (both SSH and telnet logins). Teraterm macro language is documented at MACRO Help Index

Teraterm also can be used as Cygwin terminal (in addition to the entry in the File menu it has a shortcut Alt-G). It is a much better command window then windows CMS and is highly recommended for all Cygwin users

Generally you should use version 4.58 or later (the current version is 4.62)  as there were important additions to macro language in recent versions (starting from 4.52):

2006.2.10 (Ver 4.27)

2006.10.09 (Ver 4.46)

2007.8.8 (Ver 4.53)

2007.9.30 (Ver 4.54)

New:

Priority Operator
1 not ~ ! +(unary) -(unary)
2 * / %
3 + -
4 >> << >>>
5 and &
6 xor ^
7 or |
8 < > <= >=
9 = == <> !=
10 &&
11 ||

Old:

Priority Operator
1 not ~ ! +(unary) -(unary)
2 * / %
2 and &
3 + -
3 or xor | ^
4 = <> < > <= >=
5 &&
6 ||

2007.12.4 (Ver 4.56)

2008.1.15 (Ver 4.57)

2008.6.25 (Ver 4.59)

added 'strmatch' macro command.
- added 'setrts' and 'setdtr' macro command.

2008.9.23 (Ver 4.60)

- added 'crc32' and crc32file macro command.
- added 'getttdir' macro command.

2009.3.22 (Ver 4.62)

Here is funny a sample program:

; 1. Open Tera Term Pro (free VT100 emulator)
; 2. Control -> Macro
; 3. choose 99b.ttl
;
; it will run even if you close the app, to kill prematurely please open
; taskmanager and kill the ttpmacro.exe
;
; 99 Bottles of Beer macro for Tera Term
; by Lance Yamada

for i 99 1
j = i - 1
int2str istr i
int2str jstr j
        strconcat istr ' bottles of beer on the wall,'
strconcat jstr ' bottles of beer on the wall!'

if i = 1 then
messagebox '1 bottle of beer on the wall,' 'Tera Term'
messagebox 'time to get more beer!' 'Tera Term'
else
messagebox istr 'Tera Term'
messagebox 'take one down pass it around,' 'Tera Term'
messagebox jstr 'Tera Term'
endif
next

Several sample ttl file are included with Teraterm but they usually need some minor tweaking before they work with real servers.  For example:

; sample macro of Tera Term
; 
; File: ssh2login.ttl
; Description: auto login with SSH2 protocol
; Environment: generic
; Update: 2004/12/4
; Author: Yutaka Hirata

username = 'nike'
hostname = '192.168.1.3'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

msg = 'Enter password for user '
strconcat msg username
passwordbox msg 'Get password'

msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg inputstr

Good source of inspiration can also be

Special utility LogMeTT written by Boris Maisuradze permits convenient storage of login macros for various servers greatly simplifying  the task of getting to the right server in minimum time and with minimum hassle (if macros contain passwords they probably should be protected via encrypted drive or similar method). It permits grouping server by location, by operating system, etc. It is highly recommended and really worth the effort of learning the interface.  Among notable features:

Please note that many users try to reinvent the bicycle in a form of yet another macro language for terminal emulation. Expect is a more universal and often more powerful way of doing the same. It frees you from the dependency of somebody design mistakes and the luck of understanding of compiler/interpreter technology. You should learn to use it on Unix. The efforts instantly pay for itself. 

The teraterm.ini file contains all the configuration settings and parameters used by the application. You may modify the file directly in editor. or through the executable (teraterm.exe) by changing settings then saving the configuration via the Setup --> Save Setup... menu.

Multiple setup file are possible, for example one for AIX, one for HP-UX, one for Solaris and one for Linux.

Modern versions of Teraterm keep the list recently visited hosts. That's a very convenient feature. 

 


Notes:
  • This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Some amount of grammar and spelling errors should be expected.
  • The site contain some broken links as it develops like a living tree... Please try to use Google, Open directory, etc. to find a replacement link (see HOWTO search the WEB for details). We would appreciate if you can mail us a correct link.
Google Search
Open directory

Research Index

Old News ;-)

[Mar 22, 2009] TeraTerm Support Forums • View topic - Tera Term 4.62 released

Hi everyone,

Tera Term 4.62 has just been released.

Here is the link to download page:

http://www.logmett.com/index.php?/Downl ... m-462.html

Additional information is available from the links below:

Here are the documents.

http://ttssh2.sourceforge.jp/manual/en/

http://ttssh2.sourceforge.jp/manual/en/macro/

The links below contain the list of added features and bugs fixed:

TeraTerm - http://logmett.com/forum/viewtopic.php?t=3

TTSSH - http://logmett.com/forum/viewtopic.php?t=29

LogMeTT - http://logmett.com/forum/viewtopic.php?t=45

 
_________________
Best regards,
NAGATA Shinya
http://ttssh2.sourceforge.jp/
 

SourceForge.jp Project File List

4.30 - [ Release Notes / Change Log ]       teraterm_utf8_430.exe 2.3 MB 2028 2006-03-07 01:18 fffba4dcdb1b210d582a2efd0604a282
ttssh2
 
    2.20 - [ Release Notes / Change Log ]
        ttxssh2_220.zip 525.7 KB 653 2006-03-09 22:51 6c7a7064ecac0d04f2d80a1e28884f78
    2.19 - [ Release Notes / Change Log ]
        ttxssh2_219.zip 525.6 KB 551 2006-03-02 23:43 385117f67edd52b4a3079b309f765bb9
    2.18 - [ Release Notes / Change Log ]
        ttxssh2_218.zip 628.2 KB 4737 2005-11-05 03:50 7f7ad5838f17f5d97d3623c51f3cab60
    2.13 - [ Release Notes / Change Log ]
        ttxssh2_213.zip 546.3 KB 4226 2005-04-24 20:33 584108f9d8168692252f41b4a532a53e
   

[ Mar 16, 2007 ] TeraTerm Support Forums View topic - First step to Tera Term Macros

linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Fri Mar 16, 2007 5:34 pm    Post subject: First step to Tera Term Macros  

First to all I want to congratulate this wonderful tool of trade 


I'm willing to take my first step into Tera Term Macros and I will probably won't make it on my own.

So here's the deal.

I want to be able to telnet to an access router in a companies HQ and then telnet into all the switches and do a "show tech" command in order to backup all the configs and informations about the switches into a text file.

All the switches are Cisco 2950.


Please help this poor man in need of your assistance.

With My best regards,
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Fri Mar 16, 2007 6:34 pm    Post subject:  

Depending on the number of switches different approaches can be taken. Can you say roughly how many switches you need to connect to?
_________________
Thanks.
Best regards,
// Boris
   
linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Fri Mar 16, 2007 6:37 pm    Post subject:  

boris wrote:
Depending on the number of switches different approaches can be taken. Can you say roughly how many switches you need to connect to?

About 600 Switches :s

Cheers,
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Fri Mar 16, 2007 7:16 pm    Post subject:  

TeraTerm macro can definitely help you but writing such script is not an easy task. I'd suggest you to approach it in few steps.

Start with writing telnet connection macro script to establish connection to your access router in HQ. You can use connection template from LogMeTT or sample code from one of the topics in these forums.

Then develop your script further to establish the second connection.

Step 3 will be to get familiar with opening and closing log files from macro. Here you can also add your "show tech" command.

Once you get to this point your macro will be able to reach one of your Cisco-s collect printout and save it into local file.

Then comes the tricky part. You need to store IP addresses of all your 600 switches in plain text file and run your macro in the loop where every execution will be using one IP from your IP list. Similar issue was discussed not long ago on our forums; just do some search and reading here. 2 more files that will help you are macro.hlp and LogMeTT.chm. You will find them both in TeraTerm package. Finally do not forget to give different file names to each log file. You probably can build log name from IP address and current time stamp. Check code snippets in our forums for the example.
_________________
Thanks.
Best regards,
// Boris
   
linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Fri Mar 16, 2007 8:24 pm    Post subject:  

I'm feeling a bit fuzzy about this ....


My first piece of code turned out something like this:

connect 'ip address:23 /nossh' ----> that's my office
wait'Username:'
sendln'usernamexxx'
wait'Password:'
sendln'passwordxxx'
wait'hostname>'
sendln'telnet 172.23.128.11' ----> that's the HQ of the company
wait'Username:'
sendln'usernamexxx'
wait'Password:'
sendln'passwordxxx'

fileopen filehandle 'file.txt' 0

filereadln filehandle line

while result=0

sendln line

wait'Username:'
sendln'usernamexxx'
sendln'passwordxxx'
sendln 'show tech'
sendln'exit'

endwhile

exit


My problem is that the macro does read the first ip address of the text file but it doesn't continue with the other ones.

Regarding the issue of saving the logs with each hostname or ip address, that remains a complete phantom to me.


Hope that explained myself correctly to you.


My regards,
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Sat Mar 17, 2007 6:22 am    Post subject:  

Do you have word 'telnet' followed by IP address on each line of your file.txt?
_________________
Thanks.
Best regards,
// Boris
   
linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Sat Mar 17, 2007 2:45 pm    Post subject:  

No. Just the ip addresses. why ? is it supposed to ?
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Sat Mar 17, 2007 5:03 pm    Post subject:  

The same way as you do
Quote:
sendln'telnet 172.23.128.11'
earlier in your script, you need to pass method of connection and IP address in
Quote:
sendln line
Content of variable line is one string of your file.txt. If file does not contain words 'telnet' than you get as the result
 
Code:
sendln  172.23.x.y  ; <- whatever IP you have
which is the same as if you would type only IP address at command prompt without mentioning whether you need telnet, ssh, rlogin etc.

Instead of adding 600 words 'telnet' to your file, the better approach would be to concatenate word 'telnet' and IP taken from the file.

The code can look like this:
 
Code:
...

fileopen filehandle 'file.txt' 0

filereadln filehandle line

while result=0
connect_line='telnet ' ; <-- make sure you have trailing space
strconcat connect_line line
sendln connect_line

wait'Username:'
sendln'usernamexxx'
sendln'passwordxxx'
sendln 'show tech'
sendln'exit'


endwhile
...

_________________
Thanks.
Best regards,
// Boris
   
linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Sun Mar 18, 2007 10:46 am    Post subject:  

Okay.
I have something like this...
I'm testing with a .txt file with just two ip addresses for testing.
The thing is that he only telnets into the first ip address in that file and doesn't jump into the 2 ip address.
Could it be something with the while procedure ?


sendln line

while result=0
connect_line='telnet ' ;
strconcat connect_line line

wait'Username:'
sendln'XXXXX'
sendln'XXXX'
timeout = 4
sendln 'show tech'
sendln'exit'

endwhile




Thank you for your assistance
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Sun Mar 18, 2007 11:11 am    Post subject:  

Read description of strconcat function. Your connection string is in connect_line and not in line.
There are few other issues with your last code. Please post here your complete macro, otherwise it is unclear if there are scripting or copy/pasting errors.
_________________
Thanks.
Best regards,
// Boris
   
linkstate
Newbie


Joined: 16 Mar 2007
Posts: 7

 
Posted: Sun Mar 18, 2007 11:18 am    Post subject:  

Let me see if I can explain this better to you.



Here's the whole code with comments





connect '213.xx.xx.xx:23 /nossh' ---> My first telnet to my company
wait'Username:'
sendln'xxxxxxx'
wait'Password:'
sendln'xxxxxxx'
wait'hostname>'
sendln'telnet 172.23.xx.xx' ---------> My telnet to the other company
wait'Username:'
sendln'xxxxx'
wait'Password:'
sendln'xxxxxxx'

-------------"So far So good here"--------------------


fileopen filehandle 'andre.txt' 0

filereadln filehandle line



sendln line

while result=0
connect_line='telnet ' ;
strconcat connect_line line

wait'Username:'
sendln'xxxxx'
wait'Password:'
sendln'xxxxx'
timeout = 4
sendln 'xxxxx'
sendln'exit'

endwhile





exit
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Sun Mar 18, 2007 2:48 pm    Post subject:  

Try this code

 
Code:
connect '213.xx.xx.xx:23 /nossh'
wait 'Username:'
sendln 'xxxxxxx'
wait 'Password:'
sendln 'xxxxxxx'
wait 'hostname>'
sendln 'telnet 172.23.xx.xx'
wait 'Username:'
sendln 'xxxxx'
wait 'Password:'
sendln 'xxxxxxx'

fileopen filehandle 'andre.txt' 0

while result=0
 connect_line='telnet '
 filereadln filehandle line
 strconcat connect_line line
 sendln connect_line
 wait 'Username:'
 sendln 'xxxxx'
 wait 'Password:'
 sendln 'xxxxx'
 timeout = 4        ; I'm not sure why do you need this line
 sendln 'xxxxx'     ; and this line
 sendln 'show tech'
 wait 'xxxxxxxxx'  ; <= whatever appears at the end of 'show tech'  printout
 sendln 'exit'
endwhile

fileclose filehandle

exit

_________________
Thanks.
Best regards,
// Boris
   
IshmaelCallMe
Coach


Joined: 25 Jan 2006
Posts: 119
Location: Denver, Colorado, USA

 
Posted: Mon Mar 19, 2007 6:53 am    Post subject:  

You need to move your filereadln command to just before the while and a copy of it to just before the endwhile so that the result variable gets set correctly for both the first and subsequent loops.
   
boris
Guru


Joined: 08 Jan 2005
Posts: 496
Location: Seattle, WA, USA

 
Posted: Mon Mar 19, 2007 7:14 am    Post subject:  

Thanks, I missed that 

 
Code:
connect '213.xx.xx.xx:23 /nossh'
wait 'Username:'
sendln 'xxxxxxx'
wait 'Password:'
sendln 'xxxxxxx'
wait 'hostname>'
sendln 'telnet 172.23.xx.xx'
wait 'Username:'
sendln 'xxxxx'
wait 'Password:'
sendln 'xxxxxxx'

fileopen filehandle 'andre.txt' 0
filereadln filehandle line

while result=0
 connect_line='telnet '
 strconcat connect_line line
 sendln connect_line
 wait 'Username:'
 sendln 'xxxxx'
 wait 'Password:'
 sendln 'xxxxx'
 timeout = 4        ; I'm not sure why do you need this line
 sendln 'xxxxx'     ; and this line
 sendln 'show tech'
 wait 'xxxxxxxxx'   ; <= whatever appears at the end of 'show tech'  printout
 sendln 'exit'
 filereadln filehandle line
endwhile

fileclose filehandle

exit

_________________
Thanks.
Best regards,
// Boris
   
IshmaelCallMe
Coach


Joined: 25 Jan 2006
Posts: 119
Location: Denver, Colorado, USA

 
Posted: Mon Mar 19, 2007 8:11 am    Post subject:  

There ya go, that oughta work. 

One additional thing I would suggest to the original poster is to set the "timeout" variable BEFORE any wait or waitln statements (not in the middle of the loop, as it is now!) and then (ideally) check the "result" variable each time.

If the timeout variable is not set, I believe it defaults to 0, which means the script will wait forever at that point if the text does not show up.

SourceForge.jp Project File List

4.30 - [ Release Notes / Change Log ]
        teraterm_utf8_430.exe 2.3 MB 2028 2006-03-07 01:18 fffba4dcdb1b210d582a2efd0604a282
ttssh2
 
    2.20 - [ Release Notes / Change Log ]
        ttxssh2_220.zip 525.7 KB 653 2006-03-09 22:51 6c7a7064ecac0d04f2d80a1e28884f78
    2.19 - [ Release Notes / Change Log ]
        ttxssh2_219.zip 525.6 KB 551 2006-03-02 23:43 385117f67edd52b4a3079b309f765bb9
    2.18 - [ Release Notes / Change Log ]
        ttxssh2_218.zip 628.2 KB 4737 2005-11-05 03:50 7f7ad5838f17f5d97d3623c51f3cab60
    2.13 - [ Release Notes / Change Log ]
        ttxssh2_213.zip 546.3 KB 4226 2005-04-24 20:33 584108f9d8168692252f41b4a532a53e
   

Using telnet's command mode

When you use the Solaris telnet command to log in from one site to another, don't forget that you can enter telnet's command mode at any time during your session, usually by entering the following key sequence:

    [CTRL] ] (the control key and right-bracket key at the same time)

When this is successful, you'll see the following prompt:

    telnet>

Then, from the "telnet>" prompt, enter "?" to learn more about the available telnet commands. A few commands that will give you more help at the prompt are shown below:

    display        displays many current Telnet settings
    send ?        displays commands you can "send" to the remote site
    set ?             displays variables that can be set

One of my favorites (mostly when fooling around) is:

    send ayt

which means "send this message: are you there?".


Recommended Links


In case of broken links please try to use Google search. If you find the page please notify us about new location
Google     

TeraTerm -- old site

Etc

TeraTerm 3.1.3 - Telnet, SSH2, SSL Client with built in Web Server

TeraTerm Pro Web is the next generation tool for connecting with remote Telnet and SSH hosts. It is built based on the extremely popular open-source TeraTerm product put out by T. Teranishi in 1999 (click here for original site). In keeping with the original philosophy and spirit of the author, our modified version is completely free!!

Downloads TeraTerm Pro Web works on Windows 95/98, 2000, XP. Here are the latest TeraTerm Pro Web releases:

Background
As big-time fans of the original, we realized that there were a host of missing features that could make it immensely more useful, namely:



Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Disclaimer:

Last modified: September 06, 2009