Add Keypair to existing EC2 instance

前端 未结 10 901
夕颜
夕颜 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条回答
  •  情书的邮戳
    2020-11-28 17:57

    On your local machine, run command:

    ssh-keygen -t rsa -C "SomeAlias"
    

    After that command runs, a file ending in *.pub will be generated. Copy the contents of that file.

    On the Amazon machine, edit ~/.ssh/authorized_keys and paste the contents of the *.pub file (and remove any existing contents first).

    You can then SSH using the other file that was generated from the ssh-keygen command (the private key).

提交回复
热议问题