Bird
0
0

You run the command ssh -i mykey.pem ec2-user@203.0.113.5 but get a 'Permission denied (publickey)' error. What is the most likely cause?

medium📝 Predict Output Q4 of 15
AWS - EC2 Fundamentals
You run the command ssh -i mykey.pem ec2-user@203.0.113.5 but get a 'Permission denied (publickey)' error. What is the most likely cause?
AThe private key file permissions are too open
BThe EC2 instance is stopped
CThe username is incorrect
DThe IP address is wrong
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'Permission denied (publickey)' error meaning

    This error usually means SSH key authentication failed.
  2. Step 2: Identify common causes of SSH key failure

    If the private key file permissions are too open, SSH refuses to use it for security.
  3. Final Answer:

    The private key file permissions are too open -> Option A
  4. Quick Check:

    SSH key permission issues cause 'Permission denied' errors [OK]
Quick Trick: Set private key file permission to 400 or 600 [OK]
Common Mistakes:
  • Assuming instance stopped causes this error
  • Blaming wrong IP without checking key
  • Ignoring username correctness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes