Create SSH Key

Create SSH key

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

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

ssh-keygen

Set up

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

If you encounter 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/id_rsa.pub

Set up

  1. Access EC2
  • Select Key pairs
  • See the key uploaded to the current region

Set up