Generate SSH Key

Generate SSH key

  1. We execute the command to generate SSH key in Cloud9. This key will be used to access the node instance

We can access it with the command: ssh -i PRIVATE_KEY.PEM ec2-user@EC2_PUBLIC_DNS_NAME


Set up

  1. We do upload public key to EC2 region
aws ec2 import-key-pair --key-name "mythicaleks" --public-key-material file://~/.ssh/

If you get the error An error occurred (InvalidKey.Format) when calling the ImportKeyPair operation: Key is not in valid OpenSSH public key format, you can try the following command:

aws ec2 import-key-pair --key-name "mythicaleks" --public-key-material fileb://~/.ssh/

Set up

  1. Go to EC2
  • Select Key pair
  • View keys that have been uploaded to EC2 region

Set up