In AWS, what is the main reason you create a key pair?
Think about how you access a virtual server securely.
A key pair in AWS is used to securely connect to EC2 instances using SSH. It consists of a public key stored by AWS and a private key you keep safe.
You want to create a new key pair named my-key and save the private key to a file. Which AWS CLI command should you use?
Look for the official AWS CLI command to create key pairs and how to extract the private key.
The correct command is aws ec2 create-key-pair. Using --query 'KeyMaterial' extracts the private key material, and redirecting output saves it to a file.
You have many EC2 instances and want to manage SSH access securely and efficiently. Which approach is best?
Consider AWS services that allow secure access without managing SSH keys.
AWS Systems Manager Session Manager lets you connect to instances securely without SSH keys, improving security and simplifying access management.
You lost the private key file (.pem) for an EC2 instance's key pair. What is the impact and best recovery method?
Think about AWS security design and private key handling.
AWS does not store your private key. Losing it means you cannot SSH in. The recovery is to create a new key pair and update the instance's authorized keys manually or via Systems Manager.
You delete a key pair in AWS that is currently associated with several running EC2 instances. What happens to SSH access on those instances?
Consider how AWS stores public keys on instances and the effect of deleting key pairs in the console.
Deleting a key pair in AWS only removes it from the AWS console. The public key remains on the EC2 instances, so SSH access using the private key still works unless you manually remove the key from the instance.