• Support
  • Articles
  • Resources
  • Products

Macro command 'connect' syntax description

Moderator: boris

6 postsPage 1 of 1

  LOCKED 
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1606
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Sun Jan 30, 2005 2:38 pm
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
onnect 'myserver:23 /nossh'
or
onnect 'myserver:23 /telnet'
or
onnect '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
onnect 'myserver /ssh'

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

onnect 'myserver /ssh /1'
or
onnect 'myserver /ssh /2'

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

onnect 'myserver /ssh /auth=password /user=username /passwd=password'
or
onnect 'myserver /ssh /1 /auth=password /user=username /passwd=password'
or
onnect 'myserver /ssh /2 /auth=password /user=username /passwd=password'
or
onnect 'myserver /ssh /auth=publickey /user=username /passwd=password /keyfile=private-key-file'
or
onnect 'myserver /ssh /1 /auth=publickey /user=username /passwd=password /keyfile=private-key-file'
or
onnect '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.



onnect 'myserver /ssh /auth=password /user=username /ask4passwd' or
onnect 'myserver /ssh /1 /auth=password /user=username /ask4passwd' or
onnect 'myserver /ssh /2 /auth=password /user=username /ask4passwd' or
onnect 'myserver /ssh /auth=publickey /user=username /ask4passwd /keyfile=private-key-file'or
onnect 'myserver /ssh /1 /auth=publickey /user=username /ask4passwd /keyfile=private-key-file' or
onnect '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
onnect '/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
etsync 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

Is it possible to Input comport as variable ?

Kapil Singh
Newbie

Posts:
1
Joined: Thu Jan 10, 2008 10:33 am
by Kapil Singh » Thu Jan 10, 2008 10:41 am
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'

 

maya
TeraTerm Developer

Posts:
178
Joined: Mon Sep 11, 2006 1:09 pm
by maya » Thu Jan 10, 2008 11:53 am
Hi,

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

And your code
B 115200
is not a valid parameter of teraterm. Please see the manual of [url=http://ttssh2.sourceforge.jp/manual/en/commandline/teraterm.html]command line options[/url].

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

 

art71
Newbie

Posts:
4
Joined: Thu Apr 10, 2008 3:47 pm
by art71 » Sun Apr 20, 2008 7:26 pm
Hi

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

it is the first line in my macro:



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?

 

boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1606
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Sun Apr 20, 2008 7:38 pm
Does it work in "manual" mode without macro?
Thanks.
Best regards,
Boris

 

art71
Newbie

Posts:
4
Joined: Thu Apr 10, 2008 3:47 pm
by art71 » Sun Apr 20, 2008 8:08 pm
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:
Display posts from previous:
Sort by:
  LOCKED 

6 postsPage 1 of 1

Return to “Tera Term Macro Syntax and Usage (questions)”

Who is online

Users browsing this forum: No registered users
cron