Bird
0
0

You receive an SSH error stating Permission denied (publickey) when connecting to your EC2 instance. Which of the following is the most probable cause?

medium📝 Debug Q6 of 15
AWS - EC2 Fundamentals
You receive an SSH error stating Permission denied (publickey) when connecting to your EC2 instance. Which of the following is the most probable cause?
AThe private key file permissions are too open, making SSH reject it
BThe EC2 instance is stopped and cannot accept SSH connections
CThe security group does not allow outbound traffic on port 22
DThe instance's public IP address has changed and is unreachable
Step-by-Step Solution
Solution:
  1. Step 1: Check private key file permissions

    SSH requires private key files to have restrictive permissions (typically 400 or 600). If permissions are too open, SSH will refuse to use the key.
  2. Step 2: Verify other connection parameters

    While instance state and security groups affect connectivity, they usually cause different errors, not 'Permission denied (publickey)'.
  3. Final Answer:

    The private key file permissions are too open, making SSH reject it -> Option A
  4. Quick Check:

    Check key file permissions with chmod 400 [OK]
Quick Trick: Private key file must have strict permissions [OK]
Common Mistakes:
MISTAKES
  • Assuming instance is unreachable due to IP change
  • Ignoring file permission requirements
  • Confusing security group inbound/outbound rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes