In the previous step, we have generated the key-pair which we are going to use for provisioning the EC2 instance. But let us take a look at the keys and how it looks. Alright now we have the public key and the private key with us, let us create our terraform configuration file using the public key. You can first verify the terraform configuration using the terraform plan and then finally you can apply it using terraform apply.
In the previous step, we have started the EC2 instance, now we need to connect to EC2 instance using the private key. Funded by. Contents 1 Creating a SSH key pair 1. There are a number of reasons why you might wish to use your own SSH key instead of an Amazon generated one. The most obvious reason is that you already have a SSH key that you use with other machines, and simply wish to use that key with VM instances hosted on Amazon EC2.
This short tutorial takes you through the process of generating your own SSH key locally if you don't have one already , followed by uploading the public part of that key for use with Amazon VMs. Generating a SSH keypair is straightforward. You will be prompted for a password this is optional but highly recommended with which to protect your key. Windows has no OpenSSH client or server installed by default.
Once you've wiggled the mouse 'enough', you will be presented with a screen similar to the following. Don't forget to type a password which your private key will be protected with. Finally, save both your public key and private key using the buttons provided by the interface. Note that if you originally generated a key on AWS, but then uploaded it again say, to another region then you'll get a different fingerprint because it'll take the SSH2 RSA fingerprint, rather than the sha1 it shows for keys you generated on AWS.
The third key, test-uploaded , is a locally generated key In this case you need to use the following command, also shown by Daniel on the AWS forums, to generate a sha1 hash based on the private key:. It'll work on keys you converted to OpenSSH format too. If you created your key pair using a third-party tool and uploaded the public key to AWS, you can use the OpenSSL tools to generate a fingerprint from the private key file on your local machine:.
Java using BouncyCastle. SHA1: 20 bytes, MD5: 16 bytes.
0コメント