0
0
AWScloud~20 mins

Key pairs for SSH access in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SSH Key Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary purpose of an AWS key pair?

In AWS, what is the main reason you create a key pair?

ATo manage user permissions in IAM
BTo configure network routing tables
CTo securely connect to EC2 instances via SSH
DTo encrypt data stored in S3 buckets
Attempts:
2 left
💡 Hint

Think about how you access a virtual server securely.

Configuration
intermediate
2:00remaining
Which AWS CLI command creates a new key pair and saves the private key locally?

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?

Aaws ec2 create-key-pair --key-name my-key --query 'KeyMaterial' --output text > my-key.pem
Baws ec2 create-key --name my-key --output json > my-key.pem
Caws ec2 generate-key-pair --name my-key > my-key.pem
Daws ec2 new-key-pair --key-name my-key --save my-key.pem
Attempts:
2 left
💡 Hint

Look for the official AWS CLI command to create key pairs and how to extract the private key.

Architecture
advanced
2:30remaining
How to securely manage SSH access to multiple EC2 instances in a production environment?

You have many EC2 instances and want to manage SSH access securely and efficiently. Which approach is best?

ADisable SSH access and rely only on HTTP connections
BUse AWS Systems Manager Session Manager to connect without SSH keys
CCreate a unique key pair for each instance and distribute private keys to users
DUse a single key pair for all instances and share the private key with all users
Attempts:
2 left
💡 Hint

Consider AWS services that allow secure access without managing SSH keys.

security
advanced
2:00remaining
What happens if you lose the private key of an AWS key pair used for EC2 access?

You lost the private key file (.pem) for an EC2 instance's key pair. What is the impact and best recovery method?

AYou can reset the key pair directly from the EC2 instance settings
BYou can download the private key again from AWS console anytime
CAWS automatically regenerates the private key and emails it to you
DYou lose SSH access; best practice is to create a new key pair and update the instance's authorized keys
Attempts:
2 left
💡 Hint

Think about AWS security design and private key handling.

service_behavior
expert
2:30remaining
What is the behavior when you delete an AWS key pair that is associated with running EC2 instances?

You delete a key pair in AWS that is currently associated with several running EC2 instances. What happens to SSH access on those instances?

ANothing changes; instances keep the public key and allow SSH access
BSSH access is immediately revoked and connections fail
CExisting SSH sessions remain, but new SSH connections using that key fail
DAWS automatically replaces the deleted key pair on instances with a new one
Attempts:
2 left
💡 Hint

Consider how AWS stores public keys on instances and the effect of deleting key pairs in the console.