SSH Config Generator
Generate ~/.ssh/config entries for managing multiple servers. Set host aliases, usernames, ports, identity files, keep alive, jump hosts, port forwarding, and more — all in one place.
How Does the SSH Config Generator Work?
The SSH Config Generator is a free online tool that helps developers, system administrators, and DevOps engineers create properly formatted SSH configuration blocks for the ~/.ssh/config file. Instead of manually writing config entries and risking syntax errors, you can fill in the fields and get a ready-to-use config block that you simply paste into your config file.
The SSH config file is one of the most powerful yet underused features of OpenSSH. It lets you define shortcuts for servers you connect to frequently, so instead of typing ssh -i ~/.ssh/id_ed25519 -p 2222 deploy@192.168.1.100 every time, you can simply type ssh production-server. The config file supports dozens of directives that control connection behavior, authentication, tunneling, and proxy settings.
Why Use an SSH Config File?
Managing multiple servers without an SSH config file means remembering hostnames, ports, usernames, and key paths for every connection. This quickly becomes unmanageable when you work with staging, production, database, and bastion servers across multiple projects. An SSH config file centralizes all connection details in one place. It also enables advanced features like jump host proxying, where you connect through a bastion server to reach internal hosts, and local port forwarding, which lets you securely access remote services like databases through an SSH tunnel.
SSH Config Directives Explained
Each SSH config block starts with a Host directive that defines the alias you will use to connect. The HostName directive specifies the actual server address (IP or domain). User sets the login username, and Port overrides the default SSH port 22. The IdentityFile directive points to the private key used for authentication. Additional directives like ServerAliveInterval prevent dropped connections, ProxyJump enables bastion host access, and LocalForward creates SSH tunnels for port forwarding.
Best Practices for SSH Config
- Use descriptive host aliases like
prod-web-1orstaging-dbinstead of generic names - Always specify an
IdentityFileto avoid sending the wrong key to servers - Enable
ServerAliveIntervalfor long-running sessions to prevent timeout disconnections - Use
ProxyJumpfor bastion hosts instead of the olderProxyCommandsyntax - Set file permissions to
chmod 600 ~/.ssh/configto keep your config secure - Use Ed25519 keys (
id_ed25519) instead of RSA for better security and performance
Common Use Cases
Teams commonly use SSH config files for managing cloud instances on AWS EC2, DigitalOcean, and Google Cloud. The config file is also essential for Git operations over SSH when you have multiple GitHub or GitLab accounts, as you can assign different identity files to different host aliases. CI/CD pipelines, Ansible playbooks, and deployment scripts all benefit from well-organized SSH configs that abstract away connection details into simple aliases.