Bird
0
0

Why does the SSH config file apply the last matching directive when multiple Host entries match a hostname?

hard📝 Conceptual Q10 of 15
Linux CLI - SSH and Remote Access
Why does the SSH config file apply the last matching directive when multiple Host entries match a hostname?
ABecause SSH merges all matching entries and uses the first directive found
BBecause SSH reads config top to bottom and later entries override earlier ones
CBecause only the first matching Host entry is used and others ignored
DBecause SSH randomly picks one matching Host entry
Step-by-Step Solution
Solution:
  1. Step 1: Understand SSH config processing order

    SSH reads the config file from top to bottom.
  2. Step 2: Later matching Host entries override earlier ones

    If multiple Host entries match, directives in later entries override previous ones.
  3. Final Answer:

    Because SSH reads config top to bottom and later entries override earlier ones -> Option B
  4. Quick Check:

    Last matching directive wins [OK]
Quick Trick: Later config entries override earlier ones [OK]
Common Mistakes:
  • Thinking only first match applies
  • Assuming directives merge with first priority
  • Believing selection is random

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes