LoginSignup
7
13

More than 5 years have passed since last update.

TeraTermログインマクロ パスワード暗号化

Last updated at Posted at 2017-01-24

TeraTermログインマクロ パスワード暗号化

シンプルなTeraTerm SSHログインマクロのメモ。パスワードは暗号化して保存されるので、平文で記載することに抵抗がある場合にどうぞ。

hoge.ttl
username = '<user name>'
hostname = '<host name/ip>'
passwdfile = 'password.ini'
keyfile = '<SSH key filepath>'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;パスワード取得
getpassword passwdfile username passwd

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

connect msg

パスワード取得にgetpasswordコマンドを利用します。
passwdfileがなければ自動生成し、usernameに対応するパスワードがなければ入力ダイアログボックスが表示されます。
初回起動時のみパスワードを入力し、2回目以降はpasswdfileに保存されたパスワードが自動で読み込まれます。
passwdfileに保存されるパスワードは勝手に暗号化されます。

参考
7
13
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
7
13