DevTools Logo

SSH Config Generator

SSH Config Generator

Write ~/.ssh/config with aliases, identity files, jump hosts and per-line explanations.

Runs in your browser
Try an example

Hosts

2 entries
Host 1
Host 2

~/.ssh/config

2 hosts · 12 directives
Host bastion
  HostName bastion.example.com
  User ops

Host web1
  HostName 10.0.0.5
  User ubuntu
  Port 2222
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes
  ProxyJump bastion

Host *
  ServerAliveInterval 60

Host — Starts a block; SSH uses the first matching block's value for each directive.

HostName — The real DNS name or IP address to connect to.

User — Default login name for this host.

Host — Starts a block; SSH uses the first matching block's value for each directive.

HostName — The real DNS name or IP address to connect to.

User — Default login name for this host.

Port — TCP port of the SSH daemon (1–65535).

IdentityFile — Private key to offer; list multiple keys in preference order.

IdentitiesOnly — Offer only the listed keys instead of every agent identity.

ProxyJump — Connect through this jump host first (SSH -J equivalent).

Host — Starts a block; SSH uses the first matching block's value for each directive.

ServerAliveInterval — Seconds between keepalive probes to detect a dead connection.

Details

A good SSH config is a set of first-match blocks, not a list of commands. This generator emits a global Host * block first, wildcard groups next and specific aliases last, with two-space-indented directives in canonical order. ProxyJump values can reference another alias or a literal user@host:port, and the validator rejects duplicate aliases, self-jumps, cycles, bad ports and malformed forwards. Every emitted directive has a plain-language explanation so you can review the file before pasting it into ~/.ssh/config.

Aliased host

Host web1
  HostName 10.0.0.5
  User ubuntu
  Port 2222

ssh web1 expands to the full connection command.

Jump chain

Host web1
  ProxyJump bastion
Host bastion
  HostName bastion.example.com

Both stanzas are emitted coherently and cycles are rejected.

Global keepalive

Host *
  ServerAliveInterval 60
  AddKeysToAgent yes

Global defaults are emitted first so specific hosts can override them.

Examples

Aliased host

Input
web1 → 10.0.0.5, ubuntu, port 2222
Output
Host web1
  HostName 10.0.0.5
  User ubuntu
  Port 2222

ssh web1 now expands to the full connection command.

Jump chain

Input
web1 ProxyJump bastion
Output
Host web1
  ProxyJump bastion
Host bastion
  HostName bastion.example.com

Both stanzas are emitted consistently and cycles are rejected.

Wildcard group

Input
Host prod-* with ServerAliveInterval 60
Output
Host prod-*
  ServerAliveInterval 60

Wildcard blocks are emitted before specific aliases because SSH applies the first matching block.

About this tool

The SSH Config Generator writes ~/.ssh/config stanzas from a friendly host form. Each entry carries an alias, hostname, user, port, identity files and optional jump host; global Host * settings and wildcard groups are emitted first so SSH first-match semantics work in your favor.

The output is annotated: every directive has a plain-language explanation, from ProxyJump chains to IdentitiesOnly and ServerAliveInterval. Validation catches duplicate aliases, self-referential or cyclic jumps, invalid ports and forward declarations before you paste the file into a terminal.

This tool authors the client config only. Keys stay with the key-pair generator, connections are never attempted, and the whole config is assembled locally in the browser.

What this tool does not do

  • Only a practical subset of ssh_config directives is exposed; advanced Match blocks and control paths are not modeled.
  • The tool never tests connectivity or verifies that identity-file paths exist on your machine.
  • Import of an existing config supports common Host blocks only and preserves unknown directives as comments.

How to use this tool

  1. Add hosts

    Give each server an alias, hostname, user and port, then attach identity files or extra options.

  2. Define jump hosts

    Pick another alias as ProxyJump value; the validator prevents self-jumps and cycles in the chain.

  3. Set global options

    A Host * block supplies shared keepalive and agent settings; specific hosts always follow wildcards.

  4. Copy or download

    Review the explanations, then copy the config or download it as config for ~/.ssh/config.

Use cases

Many-server workflows

Replace long ssh commands with short aliases that encode user, port and key.

Bastion documentation

Record jump-host topology in a config file that new teammates can copy.

Config syncing

Export a consistent include file for ~/.ssh/conf.d across machines.

Directive order inside a host block

OrderDirective
1Host alias
2HostName / User / Port
3IdentityFile (one line per path) / IdentitiesOnly
4ProxyJump
5ServerAliveInterval / ServerAliveCountMax
6ForwardAgent / Compression / LocalForward / RemoteForward

Indentation is two spaces; directives are emitted in canonical order regardless of form order so diffs stay readable.

Common mistakes

Mistake:Putting wildcard Host * first with options that override later hosts.

Fix:SSH uses the first value it sees for each directive. Keep global defaults minimal and place specific host blocks before broad patterns when they must differ.

Mistake:Using the hostname where the alias belongs in ProxyJump.

Fix:ProxyJump accepts another configured alias or a literal user@host:port. The generator validates the alias graph to catch cycles.

Mistake:Setting ForwardAgent yes everywhere.

Fix:Agent forwarding exposes your keys to the remote host. Enable it only for trusted jump boxes and leave it off in the global block.

Frequently asked questions

Where does the SSH config file live?

For OpenSSH clients it lives at ~/.ssh/config (or %USERPROFILE%\.ssh\config on Windows). Create it if missing, paste the generated blocks, and set permissions to 600 so other users cannot read your host details.

What does ProxyJump do?

ProxyJump tells SSH to connect through another host first, replacing the older ProxyCommand -W pattern. The value can be an alias defined in the same config or a literal user@host:port. The generator checks that the target exists and rejects self-jumps and cycles.

How do host aliases work?

The Host line starts a block whose settings apply when the alias matches the command line. SSH uses the first value it sees for each directive, so the generator emits Host * first, wildcard groups next and specific aliases last. That ordering is reordered automatically with a notice if your form order differs.

Does order matter in ssh config?

Yes. For each directive, the first matching block wins; later blocks cannot override it. This is why global defaults should be minimal and specific hosts should follow broad patterns. The generated explanations call this out on every Host line.

What do IdentitiesOnly and AddKeysToAgent do?

IdentitiesOnly yes makes SSH offer only the IdentityFile paths listed for that host instead of every key in your agent, which avoids server-side key limits. AddKeysToAgent yes automatically adds a used key to the agent for the session. Use ForwardAgent yes only on trusted machines because it exposes your agent remotely.

Is my server list uploaded?

No. Hosts, usernames and identity paths are assembled entirely in the browser and the download uses a local object URL. Nothing is transmitted.

References & standards