LoginSignup
1
1

More than 1 year has passed since last update.

AWSのEC2にTeraTarmのマクロでログインする

Last updated at Posted at 2023-01-26

自分の備忘録

2022/02/01
学習中作り直しや停止起動で毎回IP変わるので
IPを毎回入力する場合と固定IPの場合に分けました

毎回IP聞いてくれるマクロ

EC2_login.ttl
;基本情報====================
username = 'ec2-user'
userkeyfile = '秘密鍵のパス'
portnum = '22'

;接続先入力================
inputbox '接続先を入力してください。' '接続先'
hostname = 'EC2のパブリックIPv4アドレス'

;実行内容================
msg = hostname
strconcat msg ':'
strconcat msg portnum
strconcat msg ' /ssh /2 /auth=publickey /user='
strconcat msg username
strconcat msg ' /keyfile='
strconcat msg userkeyfile

;サーバへ接続=================
connect msg

;マクロ終了===================
end

IP変わらない場合

EC2_login.ttl
;基本情報====================
username = 'ec2-user'
hostname = 'EC2のパブリックIPv4アドレス'
userkeyfile = '秘密鍵のパス'
portnum = '22'
 
;実行内容================
msg = hostname
strconcat msg ':'
strconcat msg portnum
strconcat msg ' /ssh /2 /auth=publickey /user='
strconcat msg username
strconcat msg ' /keyfile='
strconcat msg userkeyfile

;サーバへ接続=================
connect msg

;マクロ終了===================
end
1
1
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
1
1