AWS EC2 Key Pair

From GM-RKB
Jump to navigation Jump to search

An AWS EC2 Key Pair is a cryptographic key pair used by AWS EC2.

  • Context:
  • Example(s):
    • cat ~/.ssh/authorized_keys

      ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjVMjNs9XVBZs8AOTLLYqcsHyLoBx9g0qXQTSliC2RXZqfjXl5bl3Xnu0d7btEPvWqU1fvP/VSJ7+EfpApIS3fRdECUoMnjp6o/Hg7OKYbwg29U/hLja4GDFSQn2s1tUp4/a1lkX8X+rORF/b9G2ZKjN0He2ci7v3BpqBGx+D3H+a/yx0K4a9CRG2qI7tW/2EQcaaSDk1mT6UtxiPPU7dDsaJPalGUXfqOqAsRHWhAyKfv3Jcys1dXggZSuEFfbaTk3ytK6zWCpzU9Z7CF3kDA/b5jdJqme21+L3Tsql6cNTU3aehjIwOOW/EXUBluz/RW7Pxzg0MxxyrGy9cks221 GM-RKB

  • See: SSH, AWS EC2 Key Pair File.


References

2016


  • http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html
    • QUOTE: To create a key pair named MyKeyPair, use the create-key-pair command, and use the --query option and the --output text option to pipe your private key directly into a file.

      $ aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem

    • A fingerprint is generated from your key pair, and you can use it to verify that the private key that you have on your local machine matches the public key that's stored in AWS. The fingerprint is an SHA1 hash taken from a DER encoded copy of the private key. This value is stored in AWS and can be viewed in the EC2 management console or by calling aws ec2 describe-key-pairs. For example, you can view the fingerprint for MyKeyPair by using the following command:
$ aws ec2 describe-key-pairs --key-name MyKeyPair
{
   "KeyPairs": [
       {
           "KeyName": "MyKeyPair",
           "KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f"
       }
  ]
}