SSH鍵認証用のTeratermマクロ

結構Teratermを利用することが多いのでいつも使っているマクロをgistにあげた

; ========================================
; File : ssh_login.ttl
; Author : TakkuMattsu
; Description : ssh login
; ========================================
; User Edit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
username = 'UserName'
hostname = 'HostName'
port = 'port'
keyfile = 'key file path'
passwdfile = 'passfile.dat'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
msg = 'Enter password for user '
strconcat msg username
passwdkey = username
strconcat passwdkey '@'
strconcat passwdkey hostname
getpassword passwdfile passwdkey password
msg = hostname
strconcat msg ':port /ssh /auth=publickey /user='
strconcat msg username
strconcat msg ' /keyfile='
strconcat msg keyfile
strconcat msg ' /passwd="'
strconcat msg password
strconcat msg '"'
connect msg
view raw ssh_login.ttl hosted with ❤ by GitHub

まぁ見ればわかると思うけどUserNameとかHostNameとかを各自の環境にあわせて変えてください。

パスワード一回入力すると次回以降はpasswodfileから読み出すので入力不要