Toolsky

Free Online Tools & Utilities for Every Task.

SSH Config Generator

Create professional SSH client configuration files for easy server access.

Configure Your SSH Hosts
~/.ssh/config Preview

                    

Anyone who manages more than one server accumulates a small liturgy of connection details: the staging box is on a non-standard port, production needs a specific key, the database server hides behind a jump host, and that one client machine has a username you can never remember. Typing the full ssh command for each — flags, ports, identity files — is slow and error-prone. SSH has a built-in answer, the client config file, where each server gets a short nickname and its details are written down once. An SSH config generator builds that file for you from a form, so "ssh staging" is all you ever have to type.

What an SSH Config File Does

When you run the ssh command, the client reads a configuration file — normally ~/.ssh/config on Linux and macOS — before connecting. The file is a list of blocks, one per host alias, and each block supplies the settings for that server: its real hostname or IP address, the username, the port, the private key file to offer, and dozens of optional behaviours. The moment an alias exists, every detail behind it becomes invisible in daily use: the command shrinks to the nickname, scripts and tools that accept ssh destinations accept the nickname too, and file-transfer tools built on SSH, like scp, sftp and rsync, inherit the same settings for free. The full set of options is documented in the official ssh_config manual — the generator's job is to spare you writing the common ones by hand.

What the Generator Puts in Your Config

  • Host alias — the short nickname you will type, chosen by you: staging, db, client-x, anything memorable.
  • HostName — the server's real address, a domain name or IP.
  • User — the account name on that server, so you stop logging in as the wrong user.
  • Port — essential when the server listens on something other than the standard 22.
  • IdentityFile — the path to the private key for this host, vital when different servers expect different keys.
  • Jump host settings — a ProxyJump entry for servers reachable only through a bastion machine, so the two-hop connection happens in one command.
  • Session keep-alives — options like ServerAliveInterval that stop idle connections being dropped by firewalls.

How to Generate Your SSH Config

  1. List the servers you connect to regularly and choose a short alias for each.
  2. For the first server, enter its alias, real hostname or IP address, username and port into the generator.
  3. Add the path to its private key file if it uses key-based login — something like ~/.ssh/id_ed25519_clients.
  4. If the server sits behind a jump host, add the ProxyJump option naming the bastion (which can itself be another alias in the same file).
  5. Repeat for each additional server; if you are unsure of a target's address details, an IP information lookup or a hostname-to-IP check can confirm what you are connecting to.
  6. Generate the configuration and save it as ~/.ssh/config (on Windows, in the .ssh folder inside your user profile).
  7. Set strict permissions on the file — chmod 600 ~/.ssh/config — then test each alias with a connection.

Example: Four Servers, Four Short Names

Here is one block from a working config, for a staging server that lives on a custom port and uses its own key:

Host staging
  HostName staging.example.com
  User deploy
  Port 2202
  IdentityFile ~/.ssh/id_ed25519_staging
  ServerAliveInterval 60

The command it replaces is "ssh -p 2202 -i ~/.ssh/id_ed25519_staging deploy@staging.example.com" — plus remembering the keep-alive behaviour. With the block saved, "ssh staging" does the whole job, and "scp file.txt staging:/var/www/" works with the same brevity because scp reads the same file. Multiply that by a production host, a database reachable through staging as a jump host, and a personal VPS, and the config file becomes the single document that describes how you reach your entire infrastructure — worth backing up (it contains no secrets itself, only pointers to key files) and worth keeping tidy.

Config Habits That Prevent Lockouts and Confusion

Respect the file's one unintuitive rule: for almost every option, SSH uses the first value it finds, reading from the top — so specific host blocks belong above general defaults, and a Host * block of fallbacks goes last, not first. Permissions matter too: SSH may ignore a config or key file that other users can read, so keep the .ssh directory at 700 and the files inside at 600. When an alias misbehaves, debug with "ssh -G staging", which prints the effective configuration SSH has assembled for that host after all matching blocks — the fastest way to discover that a stray earlier block is overriding your port. Never paste private keys into the config; the file only references key paths. And when you generate config for a machine you administer for someone else, double-check the hostname before connecting: an alias pointed at the wrong server is a small typo with large potential, especially when the command after it is destructive.

Frequently Asked Questions About SSH Config Files

Where does the config file go?

At ~/.ssh/config on Linux and macOS — that is, a file named config inside the hidden .ssh folder in your home directory. On Windows, OpenSSH reads the same layout: .ssh\config inside your user profile folder.

Why is SSH ignoring my config file?

Usually permissions (the file or folder is readable by others), a misspelled option, or an earlier block supplying the value first. Run ssh -G with your alias to see the settings SSH actually assembled, and the offending line will stand out.

Does the config file store my passwords?

No. SSH config holds connection settings and paths to key files — it has no mechanism for storing login passwords. Key-based authentication is the intended pairing, and the config makes it effortless.

What is ProxyJump, in plain terms?

It tells SSH to reach the target by first connecting to an intermediate server and tunnelling through it. With ProxyJump set in the alias's block, a server that has no public address becomes reachable with the same single command as any other host.

Can one alias use a different key from the others?

Yes — that is one of the main reasons the file exists. Each Host block carries its own IdentityFile, so servers that issued you separate keys each get the right one automatically.

What does Host * mean at the bottom of a config?

It is a defaults block that applies to every host not matched more specifically above it — the right place for global preferences like keep-alives. It belongs last, because SSH takes the first value it finds for each option.

Can I use the aliases with other tools?

Yes. scp, sftp, rsync over SSH, Git's SSH remotes and most editors' remote modes all read the same config file, so an alias defined once works across your whole toolchain.

Type the Nickname, Land on the Server

A generated SSH config converts a page of memorised ports, keys and usernames into a handful of nicknames you cannot get wrong. Build it once, keep it backed up, and every server you manage is one short word away.