Difference between public and private key

EC2 key pair consists of public and private key. Public key can shared and it is used encryption or verification.
AWS stores public key in an EC2 account. When we launch EC2 instance with this key pair, it will automatically it will automatically injects the public key into instance (e.g. ec2-user on amazon Linux). The instance uses to verify your identity during connection attempts.
Private key is secret key it never shared. It is used for decrypt or verification to prove your identity. It is stored on your local machine as a .pem file format. AWS generates the file when creating key pair and lets you download once. aws doesn't store or keep a copy . If you lose it we cannot recover it from AWS.
Veuillez vous connecter pour demander, répondre, partager, aimer et voter.