EC2へのssh接続を名前でできるようにするためのconfigを作るためのコマンド
UserとIdentityFileは適宜変更してください。
aws ec2 describe-instances | jq -r '[ .Reservations[].Instances[] | [ .InstanceId, (.Tags[]? | select(.Key == "Name")).Value, .PublicDnsName ]] | sort_by(.[1]) | .[] | "Host \(.[1])\nHostName \(.[2])\nUser hoge\nPort 22\nIdentityFile /path/to/key\n"'
Author And Source
この問題について(EC2へのssh接続を名前でできるようにするためのconfigを作るためのコマンド), 我々は、より多くの情報をここで見つけました https://qiita.com/uu4k/items/abe66136ac5d634909f3著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .