If you maintain WordPress sites across more than a couple of servers, you've probably typed a command like ssh -i ~/.ssh/xxx_key.pem -p 2222 user@203.0.113.10 more times than you'd like. Remembering the right key path, port number, and username for each server isn't realistic, and copying a similar-looking command from shell history is exactly how you end up connecting to the wrong box. ~/.ssh/config solves this by letting you collect per-host settings in one file.

Note: ~/.ssh/config is a file read by the OpenSSH client — it's not a server-side setting. It lives on your local machine (Mac/Linux/Windows SSH client) and teaches it how to reach each server, typically with just a few lines per host.

Basic structure

A minimal block looks like this:

Host myserver