Add Keypair to existing EC2 instance

前端 未结 10 900
夕颜
夕颜 2020-11-28 17:32

I was given AWS Console access to an account with 2 instances running that I cannot shut down (in production). I would however like to gain SSH access to these instances, is

10条回答
  •  猫巷女王i
    2020-11-28 17:59

    You can just add a new key to the instance by the following command:

    ssh-copy-id -i ~/.ssh/id_rsa.pub domain_alias
    

    You can configure domain_alias in ~/.ssh config

    host domain_alias
      User ubuntu
      Hostname domain.com
      IdentityFile ~/.ssh/ec2.pem
    

提交回复
热议问题