1. Home
  2. Developer tools
  3. SSH Config Generator

SSH Config Generator

Stop typing ssh -i ~/.ssh/key -p 2222 [email protected]: give each server a short alias and keep the options in one file.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use SSH Config Generator

  1. Add a block per host with its alias, address, user and key.
  2. Set jump hosts and forwards where needed.
  3. Save the result as ~/.ssh/config with chmod 600.

Features

  • Host, HostName, User, Port and IdentityFile per entry
  • ProxyJump for bastion and jump hosts
  • LocalForward for tunnels to databases and dashboards
  • IdentitiesOnly to avoid “too many authentication failures”
  • Host * defaults with keep-alive and AddKeysToAgent, placed last

Supported formats

Input

  • Form input

You get

  • CONFIG

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the SSH Config Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Match blocks and Include directives are not generated.

Guide

Organising SSH connections with ~/.ssh/config

If you connect to more than a couple of servers, typing ssh -i ~/.ssh/key -p 2222 [email protected] gets old quickly, and remembering which key goes with which host is error-prone. The OpenSSH client reads ~/.ssh/config, where each server gets a short alias and its own settings. This generator builds that file from a form, including jump hosts and tunnels.

How ssh reads the file

The file is a list of Host blocks. When you run ssh alias, the client walks through the file from top to bottom and, for every option, keeps the first value it finds in a block that matches. That rule explains the layout the generator uses: specific hosts first, and a catch-all Host * block at the very end with defaults that should only apply when nothing more specific was set.

What each block sets

Host is the alias you type. HostName is the real address or DNS name, User the login name and Port the SSH port, which is left out when it is the standard 22. IdentityFile names the private key for that server. With the IdentitiesOnly option on, the block also says IdentitiesOnly yes, so ssh offers only that key instead of every key loaded in your agent, which avoids “Too many authentication failures” on servers with strict limits.

Jump hosts

Private servers are often reachable only through a bastion. ProxyJump bastion tells ssh to connect to the bastion first and tunnel through it, using the bastion’s own block for its address, user and key. It replaces older ProxyCommand recipes and works with scp, rsync and Git too. Agent forwarding is an alternative that lets the remote server use your local keys, but anyone with root on that server can then use them while you are connected, so prefer ProxyJump.

Port forwarding

LocalForward 5432 localhost:5432 opens port 5432 on your machine and forwards it through the SSH connection to port 5432 as seen from the server. With that line in place, ssh db-prod also makes the remote database available at localhost:5432 for a local client, without opening the database port to the internet.

Defaults for every host

The final Host * block can send keep-alive messages every 60 seconds and give up after three missed replies, which stops idle connections from freezing behind NAT routers, and AddKeysToAgent yes, which adds a key to the agent the first time you unlock it so you type its passphrase only once per session.

A worked example

The Sample defines three hosts. The db-prod block reads Host db-prod, HostName 10.0.2.15, User ubuntu, IdentityFile ~/.ssh/id_ed25519, IdentitiesOnly yes, ProxyJump bastion and LocalForward 5432 localhost:5432, with no Port line because it uses 22. A github.com block uses a separate key for Git, and the file ends with Host * holding the keep-alive settings. Typing ssh db-prod now hops through the bastion and opens the database tunnel in one step.

Saving the file

Save the result as ~/.ssh/config and restrict it with chmod 600 ~/.ssh/config; OpenSSH refuses to use a config file that other users can write. On Windows, the built-in OpenSSH client reads C:\Users\you\.ssh\config with the same syntax.

Checked against the current version of the SSH Config Generator on .

Frequently asked questions

Can one Host line cover several servers?

Yes. Host accepts several names and wildcards, such as Host web-* or Host app1 app2, and the options apply to every match. %h in a value is replaced by the name you typed, so HostName %h.internal.example.com expands short names.

How do I see which options ssh actually uses for a host?

Run ssh -G alias. It prints the final configuration after all matching blocks have been applied, without connecting, which is the quickest way to debug ordering and wildcard problems.

Why do I get “Too many authentication failures”?

Your SSH agent offers every key it holds, and the server disconnects after a few failures. IdentitiesOnly yes together with IdentityFile makes ssh offer only the key you named for that host.

Does the config also work for git and scp?

Yes. Git, scp, rsync and sftp all use ssh underneath, so git clone github-work:org/repo.git uses the HostName, user and key from a Host github-work block.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.