Macro command 'connect' syntax description
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Macro command 'connect' syntax description
PostPosted: Sun Jan 30, 2005 7:38 am 
Offline
Moderator, LogMeTT developer
User avatar

Joined: Sat Jan 08, 2005 7:52 am
Posts: 1140
Location: Seattle, WA, USA
Three types of connections
There are 3 types of connection you can establish from TeraTerm macro:

- Telnet connection (port 23)
- SSH1 or SSH2 connection (port 22)
- Connection via COM port

Telnet connections
Quote:
connect 'myserver:23 /nossh'
or
Quote:
connect 'myserver:23 /telnet'
or
Quote:
connect 'myserver:23'

Using /nossh is strongly recommended. Without this parameter TeraTerm will start connecting with the same method (telnet or SSH) that was used during last time when teraterm.ini file was saved. In case it was SSH than macro will try to connect via SSH and will eventually fail.

SSH connections
Quote:
connect 'myserver /ssh'

This way will start SSH connection without defining whether SSH1 or SSH2 has to be used.

Quote:
connect 'myserver /ssh /1'
or
Quote:
connect 'myserver /ssh /2'

Parameters /1 and /2 force to use SSH1 or SSH2 method.

Quote:
connect 'myserver /ssh /auth=password /user=username /passwd=password'
or
Quote:
connect 'myserver /ssh /1 /auth=password /user=username /passwd=password'
or
Quote:
connect 'myserver /ssh /2 /auth=password /user=username /passwd=password'
or
Quote:
connect 'myserver /ssh /auth=publickey /user=username /passwd=password /keyfile=private-key-file'
or
Quote:
connect 'myserver /ssh /1 /auth=publickey /user=username /passwd=password /keyfile=private-key-file'
or
Quote:
connect 'myserver /ssh /2 /auth=publickey /user=username /passwd=password /keyfile=private-key-file'

Above 6 ways allow to skip popup dialog and pass username and password directly from macro. Please note that /auth=password or /auth=publickey is the parameter saying that authentication will be done by entering password or key-file thus you should not replace the word 'password' or the word 'publickey' in it with actual values. Only the words shown above with italic font have to be substituted.

Please remember that entering actual username and password in TeraTerm macro will cause them to be stored as an open text and it is your responsibility to keep such macros in secure place.

A little bit better practice is to use getpassword and passwordbox commands that store encrypted passwords in the file.


Quote:
connect 'myserver /ssh /auth=password /user=username /ask4passwd'
or
Quote:
connect 'myserver /ssh /1 /auth=password /user=username /ask4passwd'
or
Quote:
connect 'myserver /ssh /2 /auth=password /user=username /ask4passwd'
or
Quote:
connect 'myserver /ssh /auth=publickey /user=username /ask4passwd /keyfile=private-key-file'
or
Quote:
connect 'myserver /ssh /1 /auth=publickey /user=username /ask4passwd /keyfile=private-key-file'
or
Quote:
connect 'myserver /ssh /2 /auth=publickey /user=username /ask4passwd /keyfile=private-key-file'

Above 6 ways pass username and authentication method directly from macro, and the popup asks for password.

Connections via COM port
Quote:
connect '/C=x'

Here x represents COM port number. For example to connect via COM port 1 the command will look like: connect '/C=1'

About setsync
It is highly recommended to use the macro command
Quote:
setsync 1

right after the command connect. This command switches TeraTerm into synchronous communication mode in which the buffer never overflows. See TeraTerm Macro help for more details.

_________________
Thanks.
Best regards,
// Boris


Top
 Profile E-mail  
 
 Post subject: Is it possible to Input comport as variable ?
PostPosted: Thu Jan 10, 2008 3:41 am 
Offline
Newbie

Joined: Thu Jan 10, 2008 3:33 am
Posts: 1
For example =>

inputbox 'COM PORT Number :' 'Serial COM => '
connect 'C=inputstr' /B 115200

Note : It is giving Error to me :(

Connections via COM port
Quote:
connect '/C=x'

Here x represents COM port number. For example to connect via COM port 1 the command will look like: connect '/C=1'


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 10, 2008 4:53 am 
Offline
TeraTerm Developer

Joined: Mon Sep 11, 2006 6:09 am
Posts: 144
Location: Tokyo, Japan
Hi,

You must understand how to use a string variable. Please consult some sample code, like ssh2login.ttl.

And your code
Quote:
/B 115200
is not a valid parameter of teraterm. Please see the manual of command line options.

inputbox 'COM PORT Number :' 'Serial COM => '
constr = '/C='
strconcat constr inputstr
strconcat constr ' /BAUD=115200'

connect constr

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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 12:26 pm 
Offline
Newbie

Joined: Thu Apr 10, 2008 8:47 am
Posts: 4
Hi

I'm trying to use a connect command but it does not work for me :(

it is the first line in my macro:

connect 'xx.xxx.xx.xxx:23 /nossh'


of course I have a real Ip address instead of xxx's

once I try to open a macro, my terra term opens and after 2 seconds I have a message saying : invalid host.

any idea what am I doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 12:38 pm 
Offline
Moderator, LogMeTT developer
User avatar

Joined: Sat Jan 08, 2005 7:52 am
Posts: 1140
Location: Seattle, WA, USA
Does it work in "manual" mode without macro?

_________________
Thanks.
Best regards,
// Boris


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 1:08 pm 
Offline
Newbie

Joined: Thu Apr 10, 2008 8:47 am
Posts: 4
I linked it to the main terra term program instead of ttpmacro.

Now I linked the macro files with ttpmacro and it works fine.

Sorry, my mistake :oops:


Top
 Profile  
 
 Post subject: Re: Macro command 'connect' syntax description
PostPosted: Wed Sep 09, 2009 7:12 am 
Offline
Newbie

Joined: Wed Sep 09, 2009 7:10 am
Posts: 1
Quote:
I linked it to the main terra term program instead of ttpmacro.
Now I linked the macro files with ttpmacro and it works fine.
Sorry, my mistake :oops:
Yeah! I had the same problem, but you solve it.

_________________
Stang Software | Molo Downloads | Soft Direct Links | Sunny Soft


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group