Generating SSH key
% ssh-keygen -m PEM -f AWS
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in AWS.
Your public key has been saved in AWS.pub.
The key fingerprint is:
SHA256:glcs1kVbIjb3HlrMxb3q23f8TV6zKCa+2xQDmnqTkEY ogani@omargmac.local
The key's randomart image is:
+---[RSA 3072]----+
| +.= .... |
| + = B .. .|
| Eo +.. * .|
| .o.oo .+ . . |
| .+ooS .o. . |
| ..o.. o. |
| . + .. oo|
| . ..oo .ooO|
| .+=..o.oB|
+----[SHA256]-----+
Service > EC2 > Key pairs > Import key pair
And paste it to the public SSH key field.
Then, You can log into an instance like this: $ ssh -i ~/.ssh/your-keyfile ec2-user@INSTANCE-DNS