Teratermの自動ログインマクロ

PR

作成手順

1.「○○○.ttl」を作成し「C:\Program Files\teraterm」へ配置する

2.以下を記載する ※usernameとhostnameは接続先PCに合わせて変更する

;ホスト名(IPアドレス)
hostName = 'xx.xxx.xxx.xx'
;ログインユーザー名
userName = 'xxxxx'
;キーファイル(pemファイル)
keyFilePath = 'C:\Users\user\Desktop\xxxxx\xxxxx.pem'

;接続情報の組立て
command = hostName
strconcat command ':22 /ssh /2 /auth=publickey /user='
strconcat command userName
strconcat command ' /keyfile='
strconcat command keyFilePath

;カレントディレクトリ取得
getdir currentDir
strconcat currentDir '\'

;ログファイルパスの組み立て
getdate logFileName "log_%Y%m%d%H%M%S.log"
logFilePath = currentDir
strconcat logFilePath logFileName

;接続
connect command

;ログ取得開始 
logopen logFilePath 1 1

end

3.右クリックで「開く」-「インストールされたプログラムの一覧から~」で「ttpmacro.exe」を
 選択する

4.必要に応じてデスクトップ等に 「○○○.ttl」 のショートカットを配置する

タイトルとURLをコピーしました