SSH鍵認証用のTeratermマクロ
結構Teratermを利用することが多いのでいつも使っているマクロをgistにあげた
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ======================================== | |
; 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 |
まぁ見ればわかると思うけどUserNameとかHostNameとかを各自の環境にあわせて変えてください。
パスワード一回入力すると次回以降はpasswodfileから読み出すので入力不要