Bird
0
0

Which of the following SSH commands correctly connects to an EC2 instance at IP 192.0.2.10 using the private key mykey.pem and username ec2-user?

easy📝 Syntax Q3 of 15
AWS - EC2 Fundamentals
Which of the following SSH commands correctly connects to an EC2 instance at IP 192.0.2.10 using the private key mykey.pem and username ec2-user?
Assh ec2-user@192.0.2.10 -i mykey.pem
Bssh -i mykey.pem ec2-user@192.0.2.10
Cssh -key mykey.pem ec2-user@192.0.2.10
Dssh -p mykey.pem ec2-user@192.0.2.10
Step-by-Step Solution
Solution:
  1. Step 1: Understand SSH command syntax

    The '-i' option specifies the identity file (private key) before the user@host.
  2. Step 2: Validate each option

    ssh -i mykey.pem ec2-user@192.0.2.10 uses correct syntax: ssh -i mykey.pem ec2-user@192.0.2.10.
  3. Step 3: Identify incorrect options

    ssh ec2-user@192.0.2.10 -i mykey.pem places '-i' after user@host which is invalid; C and D use wrong flags.
  4. Final Answer:

    ssh -i mykey.pem ec2-user@192.0.2.10 -> Option B
  5. Quick Check:

    Correct SSH syntax places '-i' before user@host [OK]
Quick Trick: Use '-i' before user@host in SSH command [OK]
Common Mistakes:
  • Placing '-i' after the username and IP
  • Using incorrect flags like '-key' or '-p' for key files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes