Skip to main content

SSH Config File Generator

Generate a ready-to-paste ~/.ssh/config Host block from a simple form — set the Host alias, HostName, User, Port, IdentityFile, ProxyJump, ServerAliveInterval, StrictHostKeyChecking and ForwardAgent/IdentitiesOnly options, plus a global Host * block. Runs entirely in your browser.

Input

The name you type after `ssh` (e.g. `ssh my-server`).

Global & output options

Output

Generated ~/.ssh/config
 
Was this helpful?

Guides

The SSH Config File Generator builds a clean, ready-to-paste ~/.ssh/config Host block from a simple form. Instead of remembering the exact keyword spelling and indentation OpenSSH expects, fill in the fields you need and copy the generated block straight into your config file.

Why use an SSH config file

An SSH config file lets you replace long, error-prone commands like ssh -i ~/.ssh/id_ed25519 -p 2222 ubuntu@203.0.113.10 with a short alias — ssh my-server. It also stores per-host defaults (identity key, port, jump host, keep-alive interval) so every connection to that host behaves consistently across your terminal, Git, scp, and rsync. The file lives at ~/.ssh/config on macOS and Linux, and C:\Users\<you>\.ssh\config on Windows.

How to use this tool

  1. Enter a Host alias — the short name you'll type after ssh (for example my-server or github.com).
  2. Fill in the connection details you need. Every field is optional except the alias; blank fields are simply left out of the output.
  3. Toggle the global and header options if you want an initial Host * block or a descriptive comment.
  4. Copy the generated block, or download it as a file named config, and place it in ~/.ssh/config.

Supported directives

  • HostName — the real hostname or IP address to connect to.
  • User — the login username.
  • Port — a non-default SSH port.
  • IdentityFile — path to the private key for this host.
  • ProxyJump — a bastion/jump host to route the connection through.
  • ServerAliveInterval — seconds between keep-alive packets to stop idle disconnects.
  • StrictHostKeyCheckingyes, accept-new, no, or ask (or the OpenSSH default).
  • ForwardAgent — forward your local SSH agent to the remote host.
  • IdentitiesOnly — only use the specified IdentityFile, ignoring other keys the agent offers.
  • Global Host * block — optionally add AddKeysToAgent yes and, on macOS, UseKeychain yes so passphrases are loaded automatically.

Formatting

The output follows the conventional OpenSSH style: each Host line is unindented, and its directives are indented by two spaces. Multiple sections (the header comment, the global Host * block, and your host entry) are separated by a blank line. This is purely a readability convention — OpenSSH does not require the indentation — but it keeps large config files easy to scan.

Can I add more than one host?

Yes. Generate one block per host and paste them one after another into the same ~/.ssh/config file. Directives under a Host line apply until the next Host line, so ordering matters only for wildcard patterns like Host *, which is why the global block is emitted first.

Is my data uploaded anywhere?

No. The config is generated entirely in your browser with client-side JavaScript. Hostnames, usernames, and key paths never leave your machine.

sshconfigdevopsopensshsysadmingenerator

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/ssh-config-file-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "github.com",
    "hostName": "github.com",
    "user": "git",
    "identityFile": "~/.ssh/id_ed25519",
    "identitiesOnly": "true",
    "includeHeader": "true"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `ssh-config-file-generator` tool (SSH Config File Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.