概要 AWS Session Managerを使うと踏み台サーバが不要になるのでサーバサイドは設定しました。クライアント側でわざわざEC2のinstance IDを指定するのが大変なのでかんたんにssh接続できるように設定します。 設定手順 同じ作者のshell scriptである、ssh-over-ssmとssm-toolを使います。接続のたびに、裏で勝手にsshのキーペアを作成してログインできるようにしてくれます。また、EC2のisntance idを人間がわかりやすい名前でアクセスできるように設定してくれます。 % ghq get [email protected]:elpy1/ssh-over-ssm.git % cp ~/ghq/github.com/elpy1/ssh-over-ssm/ssh-ssm.sh ~/bin/ % ghq get [email protected]:
![AWS session managerのクライアント設定](https://cdn-ak-scissors.b.st-hatena.com/image/square/8b16cb9af729c4bf52f2f2ea09b57679ef8cf088/height=288;version=1;width=512/https%3A%2F%2Fmatsu.teraren.com%2Fblog%2Fwp-content%2Fuploads%2F2021%2F02%2Fimage-19.png)