SSH Config Generator
Name each server once. Then connect with ssh and a short alias.
Free · No signupBuilt in your browser
Host 1 of 1
The name you type after ssh. Separate several names with spaces; * matches anything.
More options Keepalive, host keys, any directive
Seconds between checks. Stops idle drops.
Unanswered checks before SSH disconnects.
What SSH does with a host key it has not seen.
Helps on slow links; slower on fast ones.
Any other ssh_config directive, added to this host as written.
Host web HostName 203.0.113.10 User deploy IdentityFile ~/.ssh/id_ed25519 IdentitiesOnly yes
Then connect with
ssh web
More servers than you can remember
Save your servers in CtrlOps instead.
Connect with keys, a password or a pasted connection string, and manage every server from one local desktop app.
Keep it handy
The directives
you will use most.
Each line in a host block is a directive and a value. Names are not case-sensitive, and SSH ignores blank lines and lines that start with #.
| Directive | What it does | Example |
|---|---|---|
Host | Starts a block. The alias or patterns that block applies to. | Host web |
HostName | The real hostname or IP address the alias connects to. | HostName 203.0.113.10 |
User | The login name, so you can drop user@ from the command. | User deploy |
Port | The SSH port on the server. Leave it out to use 22. | Port 2222 |
IdentityFile | The private key to offer for this host. | IdentityFile ~/.ssh/id_ed25519 |
IdentitiesOnly | Offer only the IdentityFile key, not every key in your agent. | IdentitiesOnly yes |
AddKeysToAgent | Add the key to your running agent after first use, so the passphrase is asked once. | AddKeysToAgent yes |
ProxyJump | Connect through a bastion or jump host first. | ProxyJump bastion |
ForwardAgent | Let the server use your local agent for onward SSH. Trusted hosts only. | ForwardAgent yes |
ServerAliveInterval | Seconds between keepalive messages, so idle sessions stay open. | ServerAliveInterval 60 |
ServerAliveCountMax | Unanswered keepalives allowed before SSH drops the connection. | ServerAliveCountMax 3 |
StrictHostKeyChecking | What SSH does with unknown or changed host keys. | StrictHostKeyChecking accept-new |
Compression | Compress traffic. Helps on slow links only. | Compression yes |
How SSH reads it
First match wins.
Order matters.
What the SSH config file does
~/.ssh/config saves connection settings per host, so a command like ssh -i ~/.ssh/id_ed25519 -p 2222 deploy@203.0.113.10 becomes ssh web. The same aliases work for scp, rsync, git and anything else built on OpenSSH.
Specific hosts first, defaults last
SSH checks every Host block from top to bottom. When several match, it merges them, and for each option it keeps the first value it read. That is why a Host * block of shared defaults belongs at the end: anything you set for a specific host above it still wins.
Patterns and wildcards
A Host line can list several names, separated by spaces. * matches any characters and ? matches one, so Host *.internal covers every internal hostname. Start a pattern with ! to exclude a host.
Save it with the right permissions
Copy the install command to create ~/.ssh if needed, keep a backup of your current file, append the new hosts and set chmod 600. Prefer to do it by hand? Download the file, move it to ~/.ssh/config and set the same permissions. The chmod calculator explains what 600 and 700 allow.
Test before you connect
ssh -G web prints the final settings SSH would use for web without connecting. Need a key for IdentityFile first? Create one with the SSH key generator.
Before you save
SSH config,
explained.
Where is the SSH config file located?
The per-user SSH config file lives at ~/.ssh/config on macOS and Linux, and at C:\Users\<you>\.ssh\config on Windows with the OpenSSH client. System-wide defaults are stored in /etc/ssh/ssh_config. If the ~/.ssh directory does not exist yet, create it before adding the file.
What is the difference between Host and HostName?
Host is the alias you type after ssh - for example "ssh myserver". HostName is the real address that alias points to, such as an IP like 192.0.2.10 or a domain. This lets you connect with a short, memorable name instead of the actual hostname.
How do I use multiple SSH keys for different hosts?
Add a separate Host block for each server and set its IdentityFile to the correct private key. Enable IdentitiesOnly yes so SSH uses only that key rather than offering every key in your agent, which prevents "too many authentication failures" errors on servers that limit attempts.
What does ProxyJump do?
ProxyJump tells SSH to connect through an intermediate bastion or jump host before reaching the target server. For example, ProxyJump bastion routes the connection through the host aliased "bastion" first. It replaces the older, more verbose ProxyCommand with netcat approach.
How do I set the correct permissions on the SSH config file?
Run chmod 600 ~/.ssh/config so only your user can read and write it, and chmod 700 ~/.ssh on the directory. OpenSSH rejects a user config file with an incorrect owner or permissions that let other users write to it. You can use our chmod calculator at /tools/chmod-calculator to see exactly what those values mean.
Does the order of hosts in the config file matter?
Yes. For each setting, SSH uses the first matching value it finds reading top to bottom. Put specific Host entries before broad wildcard entries (like Host *) so the specific settings win. The generator outputs your hosts in the order you add them.
Keep exploring
Tools and guides for your next step.