{"id":"49d46ba0-5947-41ed-83b1-4a9d5e9363bc","task":"Create reusable per-host SSH connection aliases in ~/.ssh/config so a short name like 'ssh myhost' expands to the correct hostname, user, port, and identity file instead of typing full connection details every time.","domain":"openssh.com","steps":["Ensure the SSH directory exists with correct permissions: run `mkdir -p ~/.ssh && chmod 700 ~/.ssh`, then create or open `~/.ssh/config` in a text editor.","Add a Host block per target server, e.g.: 'Host myhost' followed by indented lines 'HostName 203.0.113.10', 'User deploy', 'Port 2222', 'IdentityFile ~/.ssh/id_ed25519_myhost'. Host is the alias pattern matched on the ssh command line; HostName is the real host/IP to connect to (default: the name given on the command line); User sets the remote login user; Port sets the remote port (default 22); IdentityFile selects the private key to offer.","Restrict permissions on the file: `chmod 600 ~/.ssh/config`.","Verify the merged configuration before connecting: run `ssh -G myhost` to print exactly which hostname, user, port, and identityfile ssh resolved for that alias.","Connect using the alias: `ssh myhost`.","If multiple Host blocks could match the same alias (e.g. a specific 'Host myhost' plus a general 'Host *' defaults block), place the more specific block ABOVE the general one in the file."],"gotchas":["ssh_config resolves each directive with 'first obtained value wins': for any given directive, only the value from the first matching Host/Match block in the file is used, so a later block matching the same alias cannot override a directive already set earlier. Docs: https://man.openbsd.org/ssh_config.5","Because of first-match-wins, host-specific Host blocks must be placed near the top of the file and general 'Host *' defaults at the end, per ssh_config(5)'s own recommendation.","Host pattern matching happens against the literal alias typed on the ssh command line (before HostName substitution), unless CanonicalizeHostname is enabled; a misspelled alias simply matches no block and ssh proceeds with built-in defaults instead of erroring.","IdentityFile is an exception to first-obtained-value-wins: multiple IdentityFile lines across matching blocks are additive and all are tried in order, unlike most other directives.","Keep ~/.ssh/config private (chmod 600): ssh may refuse to use a config file with overly permissive permissions, and it can contain sensitive host/identity details either way."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T22:40:24.068Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T22:40:24.068Z"},"url":"https://mcp.waymark.network/r/49d46ba0-5947-41ed-83b1-4a9d5e9363bc"}