Auto login with Tera Term macro

I’m using Tera Term for login and work on a server. And, I feel it is annoying to login manually.

Tera Term has the macro functionality. So, it can login to server by only Double Click by some settings.

In this article, I introduce how to auto login by Tera Term macro.

【Step1】Associate with macro file(.ttl file)

The macro file extension is “.ttl”. So, to set file association to execute Tera Term macro(ttpmacro.exe)  by double click .ttl file.

The following the article is useful, please see.
https://www.lifewire.com/how-to-change-file-associations-in-windows-2624477

【Step2】Create macro file(.ttl file)

This is a sample .ttl file.

Change the following setting depending on your environment.

  • username:User name to login
  • password:User password
  • hostname:Server host name or IP address
  • logfilename:Log file name (entered command and output is written)
  • /auth:How to authenticate
  • logdir:Output folder of log fil
;================================================
; Teraterm auto login macro
;================================================
username = 'User name'
password = 'password'
hostname = 'Server host name or IP Address>'
logfilename = '<log file name>'
 
strconcat msg username
msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
; 「/auth=」: set authentication type
; /auth=password: Password authentication
; /auth=publickey: Public key authentication
; /auth=challenge: Challenge-response authentication
; /auth=pageant: Using Pageant authentication
 
strconcat msg username
strconcat msg ' /passwd='
strconcat msg password
 
connect msg
 
; Output Teraterm log
logdir = 'C:\TeraTerm_logfiles\' ; Set log file directory
 
logfile = logdir
strconcat logfile logfilename
getdate datetime '-%Y%m%d-%H%M%S'
strconcat logfile datetime
strconcat logfile '.log'
logopen logfile 0 1

Create .ttl file, then double click to check login to server!!

…((((*ФωФ)ノ Go Go ♪