AI Tools Free

SSH Config Generator

Enter your Host alias, IP/domain, user, port, Ed25519/RSA key path, and optional ProxyJump or LocalForward tunnel to generate a hardened `~/.ssh/config` stanza.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Generate SSH Config.

Short alias used in 'ssh prod-api' (no spaces).

Target server IPv4, IPv6, or domain name.

Login username on the remote host.

Remote OpenSSH daemon port (default 22).

Path to your private SSH key file.

Optional bastion/jump host alias or user@bastion:22.

Optional local port tunnel in 'LocalPort RemoteHost:RemotePort' format.

Your result
Enter your details

Result will appear here

How the SSH Config Generator Works

The generator formats an indented OpenSSH `Host` stanza, validates port numbers and LocalForward syntax, and outputs the equivalent one-line `ssh` CLI command.

Host <alias> -> HostName, User, Port, IdentityFile, IdentitiesOnly yes, ServerAliveInterval 60

Includes file permission verification commands (`chmod 600 ~/.ssh/config`).

SSH Config Generator workflow overview
Workflow overview for SSH Config Generator.

OpenSSH ~/.ssh/config Directives Reference Table

Core OpenSSH client configuration directives and security hardening flags.

DirectiveExample ValuePurposeHardening Note
Hostprod-apiDefines the short CLI alias used by `ssh prod-api` or `scp`.Place specific Host blocks above wildcard `Host *` blocks.
IdentityFile~/.ssh/id_ed25519Selects the private key for public-key authentication.Prefer Ed25519 keys (`ssh-keygen -t ed25519`) over legacy RSA.
IdentitiesOnlyyesRestricts ssh-agent to only offer the configured IdentityFile.Prevents 'Too many authentication failures' on multi-key machines.
ProxyJumpbastion.example.comRoutes connection transparently through a jump/bastion host.Supports comma-separated multi-hop chains (`hop1,hop2`).
ServerAliveInterval60Sends an encrypted keepalive packet every 60 seconds.Prevents NAT firewalls from dropping idle terminal sessions.

How to Generate Your ~/.ssh/config Block

Build your OpenSSH configuration block in three steps.

Set Host alias, HostName, User, and Port

Choose a short alias like `prod-api` and enter the server's hostname or IP, username, and SSH port.

SSH Config Generator step 1: Set Host alias, HostName, User, and Port
Step 1 workflow overview for SSH Config Generator.

Specify IdentityFile private key path

Point `IdentityFile` to your private key (such as `~/.ssh/id_ed25519`).

SSH Config Generator step 2: Specify IdentityFile private key path
Step 2 workflow overview for SSH Config Generator.

Add optional ProxyJump bastion or LocalForward port tunnel

Click Generate SSH Config to copy the stanza into `~/.ssh/config` along with the equivalent CLI command.

SSH Config Generator step 3: Add optional ProxyJump bastion or LocalForward port tunnel
Step 3 workflow overview for SSH Config Generator.

Worked OpenSSH Configuration Examples

Typical production server, bastion jump, and database tunnel setups.

Production server with PostgreSQL LocalForward tunnel

Generates a 'Host prod-api' block that forwards local port 5432 to 127.0.0.1:5432 on the remote host when you run 'ssh prod-api'.

SSH Config Generator example 1: Production server with PostgreSQL LocalForward tunnel
Worked example 1 for SSH Config Generator.

Private subnet server behind a ProxyJump bastion

Adding 'bastion-jump' in ProxyJump tunnels traffic through the bastion host with a single command.

SSH Config Generator example 2: Private subnet server behind a ProxyJump bastion
Worked example 2 for SSH Config Generator.

Multi-GitHub / GitLab account key separation

Combining a custom Host alias with 'IdentitiesOnly yes' binds a specific repository remote to a dedicated SSH key.

SSH Config Generator example 3: Multi-GitHub / GitLab account key separation
Worked example 3 for SSH Config Generator.

Where to Save the Generated Stanza

Append the generated block to `~/.ssh/config` on Linux, macOS, or Windows (`C:\Users\<you>\.ssh\config`).

Once saved, connect simply by running `ssh <hostAlias>` or transfer files with `scp file.txt <hostAlias>:/tmp/`.

The detail panel also provides the one-line `ssh -i ... -p ...` command for environments where you cannot edit `~/.ssh/config`.

How to interpret SSH Config Generator results
Result interpretation guide for SSH Config Generator.

Frequently Asked Questions About ~/.ssh/config

Answers about using SSH Config Generator and understanding its results.

What does IdentitiesOnly yes do in ~/.ssh/config?

When you have multiple keys loaded in ssh-agent, OpenSSH tries every agent key before trying the Host's IdentityFile, which often trips the server's MaxAuthTries limit ('Too many authentication failures'). 'IdentitiesOnly yes' forces ssh to offer only the IdentityFile specified for that Host.

How does ProxyJump compare to ProxyCommand for bastion hosts?

Introduced in OpenSSH 7.3, 'ProxyJump bastion-host' (or 'ssh -J') natively tunnels SSH through one or more jump hosts with end-to-end encryption without spawning an external 'nc' or 'ssh -W %h:%p' ProxyCommand subprocess.

What permissions are required for ~/.ssh/config and private keys?

OpenSSH rejects ~/.ssh/config if it is group- or world-writable. Run 'chmod 700 ~/.ssh', 'chmod 600 ~/.ssh/config', and 'chmod 600 ~/.ssh/id_ed25519'.

Why does OpenSSH use the first matching directive in ~/.ssh/config?

OpenSSH evaluates ~/.ssh/config from top to bottom and keeps the first value seen for each parameter. Place specific 'Host prod-api' blocks at the top of the file and general 'Host *' defaults at the very bottom.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Generate SSH Config