Challenge - 5 Problems
SSH Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of SSH config with Host alias
Given the following SSH config snippet, what is the output of
ssh myserver if the server myserver.example.com is reachable and the user is alice?Linux CLI
Host myserver
HostName myserver.example.com
User alice
Port 2222Attempts:
2 left
💡 Hint
Look at how HostName, User, and Port are set under the Host alias.
✗ Incorrect
The SSH config defines an alias myserver that points to myserver.example.com with user alice and port 2222. So ssh myserver uses these settings.
📝 Syntax
intermediate2:00remaining
Identify the syntax error in SSH config
Which option shows a syntax error in this SSH config snippet?
Attempts:
2 left
💡 Hint
Check if all directives have values.
✗ Incorrect
Option C has User without a username value, which is invalid syntax.
🔧 Debug
advanced2:00remaining
Why does SSH ignore the Port setting?
Given this SSH config, why does
ssh server1 connect on port 22 instead of port 2200?Linux CLI
Host server1
HostName server1.example.com
Host server*
Port 2200Attempts:
2 left
💡 Hint
SSH applies the first matching Host block and ignores later ones.
✗ Incorrect
SSH uses the first matching Host block. Since server1 matches the first block exactly, it uses its settings. That block has no Port, so default 22 is used. The second block with Port 2200 is ignored for this host.
🚀 Application
advanced2:00remaining
Create SSH config for multiple hosts with shared settings
You want to connect to
web1.example.com and web2.example.com as user deploy on port 2222. Which SSH config snippet achieves this with minimal repetition?Attempts:
2 left
💡 Hint
Use Host aliases and %h to substitute hostnames.
✗ Incorrect
Option A uses a single Host line with both hosts and uses %h to substitute the hostname part, avoiding repetition.
🧠 Conceptual
expert2:00remaining
Effect of Include directive in SSH config
If your main SSH config file contains
Include ~/.ssh/config.d/*, what happens when you run ssh myhost?Attempts:
2 left
💡 Hint
Think about how SSH processes multiple config files.
✗ Incorrect
The Include directive merges settings from included files with the main config, applying them in the order they appear. This allows modular config management.