Bird
0
0

Which of the following is the correct syntax to allow inbound SSH (port 22) traffic in a Security Group using AWS CLI?

easy📝 Syntax Q3 of 15
AWS - Security Groups and Network ACLs
Which of the following is the correct syntax to allow inbound SSH (port 22) traffic in a Security Group using AWS CLI?
Aaws ec2 create-nacl-rule --group-id sg-123abc --protocol tcp --port 22 --cidr 0.0.0.0/0
Baws ec2 add-security-group-rule --group-id sg-123abc --protocol tcp --port 22 --cidr 0.0.0.0/0
Caws ec2 authorize-security-group-ingress --group-id sg-123abc --protocol tcp --port 22 --cidr 0.0.0.0/0
Daws ec2 set-security-group-rule --group-id sg-123abc --protocol tcp --port 22 --cidr 0.0.0.0/0
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct AWS CLI command for Security Group ingress

    The correct command is 'authorize-security-group-ingress' to add inbound rules.
  2. Step 2: Verify parameters

    Parameters include group-id, protocol, port, and CIDR range, matching aws ec2 authorize-security-group-ingress --group-id sg-123abc --protocol tcp --port 22 --cidr 0.0.0.0/0.
  3. Final Answer:

    aws ec2 authorize-security-group-ingress with correct parameters -> Option C
  4. Quick Check:

    Correct CLI command for ingress = authorize-security-group-ingress [OK]
Quick Trick: Use 'authorize-security-group-ingress' to add inbound rules [OK]
Common Mistakes:
  • Using incorrect CLI commands like add-security-group-rule
  • Confusing NACL commands with Security Group commands
  • Missing required parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes