SSHConfigBuilder~/.ssh/config

OpenSSH Client & Server Configuration File Generator

Generate secure, structured ~/.ssh/config files with host aliases, ProxyJump bastion hops, IdentityFile key bindings, port forwarding, and hardening rules.

Configured Hosts
3
Bastion Jumps
2
Port Forwards
1
Validation Status
100% Valid OpenSSH

Host Inventory & Parameters

(3 configured)
Host bastion

Name you type into terminal: ssh bastion

Real domain name or IPv4/IPv6 server address.

Remote login username.

SSH listening port (Default: 22).

~/.ssh/config(84 lines)
# ==============================================================================
# OpenSSH Client Configuration (~/.ssh/config)
# Built with Interactive OpenSSH ~/.ssh/config File Builder
# File permissions required: chmod 600 ~/.ssh/config (Directory: chmod 700 ~/.ssh)
# ==============================================================================
 
# ------------------------------------------------------------------------------
# Public AWS EC2 Bastion Gateway in eu-central-1
# ------------------------------------------------------------------------------
Host bastion
HostName ec2-3-120-10-5.eu-central-1.compute.amazonaws.com
User ec2-user
IdentityFile ~/.ssh/aws-bastion.pem
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
ConnectTimeout 10
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 30m
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
Compression yes
 
# ------------------------------------------------------------------------------
# Internal production web cluster node (VPC subnet)
# ------------------------------------------------------------------------------
Host prod-app-01
HostName 10.0.10.45
User ubuntu
IdentityFile ~/.ssh/vpc-production.ed25519
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ProxyJump bastion
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
ConnectTimeout 15
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 10m
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
 
# ------------------------------------------------------------------------------
# Local port tunnel to private Postgres RDS instance via Bastion
# ------------------------------------------------------------------------------
Host prod-db-tunnel
HostName 10.0.20.100
User ubuntu
IdentityFile ~/.ssh/vpc-production.ed25519
IdentitiesOnly yes
AddKeysToAgent yes
PreferredAuthentications publickey
ProxyJump bastion
LocalForward 127.0.0.1:5432 10.0.20.100:5432
ServerAliveInterval 30
ServerAliveCountMax 5
TCPKeepAlive yes
ConnectTimeout 10
ForwardAgent no
ForwardX11 no
StrictHostKeyChecking accept-new
Compression yes
 
# ------------------------------------------------------------------------------
# Global Wildcard Settings (Applies to all hosts)
# ------------------------------------------------------------------------------
Host *
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
Compression yes
AddKeysToAgent yes
StrictHostKeyChecking accept-new
ForwardAgent no
ConnectTimeout 15
 

Installation & Terminal Quick Start

1. Install to ~/.ssh/config & lock permissions
mkdir -p ~/.ssh && chmod 700 ~/.ssh cat << 'EOF' > ~/.ssh/config # [pasted configuration] EOF chmod 600 ~/.ssh/config
2. Test SSH connection with verbose debug logs
ssh -v bastion
OpenSSH Permissions Guard

OpenSSH will strictly ignore config files and keys that have loose permissions. Run:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/config ~/.ssh/id_*

ProxyJump Multi-Hop Bastion Routing

Chains encrypted Jump Host proxies (ProxyJump bastion.example.com) to seamlessly traverse DMZs and private VPC subnets without agent forwarding risks.

Strict IdentityFile & Key Binding

Enforces IdentitiesOnly yes to avoid SSH authentication failures caused by offering too many unmatched private keys from ssh-agent.

Port Forwarding & SOCKS5 Tunneling

Configures LocalForward (-L), RemoteForward (-R), and DynamicForward (-D SOCKS5 proxy) tunnels directly in your declarative config file.

Technical Reference & Architecture Guide

OpenSSH Client & Server Configuration File Generator — Reference Guide

Generate secure, structured ~/.ssh/config files with host aliases, ProxyJump bastion hops, IdentityFile key bindings, port forwarding, and hardening rules.

OpenSSH Client & Server Configuration File Generator — Reference Guide — Client-Side In-Memory Architecture & Data Flow
OpenSSH Client & Server Configuration File Generator — Reference Guide — Client-Side In-Memory Architecture & Data Flow

Key Parameters & Controls

Key Parameters & Controls
ParameterType / UnitDescriptionDefault
Host AliasstringHuman-readable shortcut used on the command line (e.g. ssh bastion, ssh prod-db).prod-bastion
HostNamestringReal remote IP address or fully qualified domain name.bastion.example.com
UserstringRemote login username for SSH authentication.ubuntu
IdentityFilestringPath to private key file (e.g. ~/.ssh/id_ed25519).~/.ssh/id_ed25519

Pro Tips & Best Practices

Native ProxyJump Bastion Routing

Modern OpenSSH (7.3+) provides ProxyJump (e.g. ProxyJump bastion) which replaces complex netcat/nc ProxyCommand syntax with clean, native routing.

Limit Keys with IdentitiesOnly

By default, ssh-agent tries every loaded key sequentially. If you have multiple keys, servers will disconnect with 'Too many authentication failures' unless IdentitiesOnly is enabled.

Prevent Timeouts with ServerAlive

Add ServerAliveInterval 60 and ServerAliveCountMax 3 to send periodic heartbeat signals, keeping NAT router states open on idle connections.

Common Gotchas & Troubleshooting

⚠️SSH error: 'Bad owner or permissions on ~/.ssh/config'

Run 'chmod 600 ~/.ssh/config' and 'chmod 700 ~/.ssh' to ensure private files are not readable by other OS users.

⚠️Connection timed out when connecting through bastion

Verify that your local machine can reach the bastion on port 22 and that the bastion can resolve and route to the internal target HostName.

Frequently Asked Questions

Where is the SSH configuration file stored?▼

On Linux and macOS, it resides at ~/.ssh/config. On Windows, it is typically located at C:\Users\<Username>\.ssh\config.

How does ProxyJump work?▼

ProxyJump establishes an encrypted tunnel to a bastion host first and automatically transparently forwards your connection to the internal destination server.

What is the recommended modern SSH key type?▼

Ed25519 (ssh-keygen -t ed25519) is the recommended standard, offering superior security and performance over legacy RSA 2048/4048 keys.

Does this tool transmit my SSH configuration anywhere?▼

No. The generator runs completely within your local browser JavaScript engine with zero server transmission.