ssh myserver if the server myserver.example.com is reachable and the user is alice?Host myserver
HostName myserver.example.com
User alice
Port 2222The SSH config defines an alias myserver that points to myserver.example.com with user alice and port 2222. So ssh myserver uses these settings.
Option C has User without a username value, which is invalid syntax.
ssh server1 connect on port 22 instead of port 2200?Host server1
HostName server1.example.com
Host server*
Port 2200SSH 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.
web1.example.com and web2.example.com as user deploy on port 2222. Which SSH config snippet achieves this with minimal repetition?Option A uses a single Host line with both hosts and uses %h to substitute the hostname part, avoiding repetition.
Include ~/.ssh/config.d/*, what happens when you run ssh myhost?The Include directive merges settings from included files with the main config, applying them in the order they appear. This allows modular config management.
