username = 'ec2-user'
hostname = 'aaa.bbb.ccc.ddd'
key_file = 'id_rsa' ← 秘密鍵ファイルを指定
passwdfile = 'passwd.dat'
portnum = '22'
getpassword passwdfile username userpasswd ← パスフレーズを暗号化ファイルとして保存
msg = hostname
strconcat msg ':portnum /ssh /auth=publickey /user=' ← 公開鍵認証を指定
strconcat msg username
strconcat msg ' /passwd='
strconcat msg userpasswd
strconcat msg ' /keyfile='
strconcat msg key_file
strconcat msg inputstr
connect msg
More than 5 years have passed since last update.
【TeraTermマクロ】公開鍵認証のSSH自動ログイン(備忘)
Last updated at Posted at 2020-02-26
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme