We can access it with the command: ssh -i PRIVATE_KEY.PEM ec2-user@EC2_PUBLIC_DNS_NAME
ssh-keygen
aws ec2 import-key-pair --key-name "mythicaleks" --public-key-material file://~/.ssh/id_rsa.pub
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/id_rsa.pub