LoginSignup
12
15

More than 5 years have passed since last update.

TeraTermマクロ作成方法

Last updated at Posted at 2018-02-03

作成前に事前にTeraTermのインストールが必要

用途

ログインの簡易化。ssh認証やパスワード認証を不要にし、クリックするだけでサーバー等へのログインが出来るようにする。※セキュリティ面に注意

作成手順

鍵認証の場合

1.ローカル環境で、テキスト等に以下の内容を記述 ※上3行のみ設定

username = 'ログインユーザ名'
hostname = 'ログイン先のIPアドレス(例:192.168.0.1)'
keyfile = 'ローカルに保存された秘密鍵のパス(例:C:\Users\foo\path\to\secret_key)'

msg = hostname
strconcat msg ':22 /ssh /auth=publickey /user='
strconcat msg username
strconcat msg ' /keyfile='
strconcat msg keyfile
connect msg

作成したテキストを「.ttl」形式のファイル名で保存する

2.ttpmacro.exeと関連付け

ダブルクリックし、実行プログラムを選択する際に、teratermプログラム関連のフォルダ内にある、ttpmacro.exeを選択。

そのまま実行すれば、ログインできる

パスワード認証の場合

1.ローカル環境で、テキスト等に以下の内容を記述 ※上3行のみ設定

username = 'ユーザー名'
hostname = 'IPアドレス (例 192.168.200.130)'
password = 'パスワード'

msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg password
connect msg

作成したテキストを「.ttl」形式のファイル名で保存

2. ※ssh鍵ありの場合と同様

12
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
15