AWS EC2 Key Pair
An AWS EC2 Key Pair is a cryptographic key pair used by AWS EC2.
- Context:
- It can be composed of an AWS EC2 Private Key, and an AWS EC2 Public Key.
- …
- 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/AWSEC2/latest/UserGuide/ec2-key-pairs.html
- QUOTE: Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. Public–key cryptography uses a public key to encrypt a piece of data, such as a password, then the recipient uses the private key to decrypt the data. The public and private keys are known as a key pair.
To log in to your instance, you must create a key pair, specify the name of the key pair when you launch the instance, and provide the private key when you connect to the instance. Linux instances have no password, and you use a key pair to log in using SSH. With Windows instances, you use a key pair to obtain the administrator password and then log in using RDP.
- QUOTE: Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. Public–key cryptography uses a public key to encrypt a piece of data, such as a password, then the recipient uses the private key to decrypt the data. The public and private keys are known as a key pair.
- 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:
- 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 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" } ] }