0
0

新規構築したRHELのEC2にキーペアを設定せずにセッションマネージャー(SSM)で接続する方法。

Posted at

概要

EC2を作成したが、セッションマネージャーだけで接続予定のためキーペアを設定したくない。
しかし、SSM Agentをインストールしないとセッションマネージャーに接続できない…
そんな場合の回避策です。

手順

  1. インスタンスを停止
  2. [アクション] - [インスタンスの設定] - [ユーザーデータを編集]
  3. [ユーザーデータをテキストで変更]にチェックが入っている状態で、[ユーザーデータをここに配置]に以下を入力して保存
    #!/bin/bash
    sudo dnf install -y https://s3.amazonaws.com/ec2-downloads- 
    windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
    sudo systemctl enable amazon-ssm-agent
    sudo systemctl start amazon-ssm-agent
    
  4. インスタンスを起動
0
0
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
0
0