SSH Config Generator
Generate SSH config files (~/.ssh/config). Manage multiple SSH keys, configure port forwarding, and define connection aliases for your servers.
Quick Summary
~/.ssh/config file that allows you to manage multiple servers with memorable connection aliases, unique private keys, and default usernames.What is this tool?
An SSH Config Generator is an online DevOps tool that scaffolds your personal ~/.ssh/config file. Instead of remembering the exact IP address, non-standard port, username, and which private key to use for every remote server you connect to, you can define simple aliases.
The generator outputs a standard configuration file that tells your local OpenSSH client exactly how to seamlessly connect to AWS EC2 instances, GitHub accounts, or local home lab servers just by typing a simple command like ssh myserver.
How to Use This Tool
- Define a Host Alias — Create a memorable nickname for your server (e.g., 'prod-db' instead of raw IP '192.168.1.50').
- Set the Hostname — Enter the actual IP address or fully qualified domain name of the remote machine.
- Specify the User — Set the default username to log in with (e.g., 'ubuntu', 'ec2-user', or 'root') so you don't have to type it.
- Select an Identity File — Provide the absolute local path to the specific private key required for this server (e.g., ~/.ssh/id_rsa_prod).
- Export Config — Download the file and save it securely as ~/.ssh/config on your local machine.
What This Tool Generates
~/.ssh/config— The client-side configuration file read by OpenSSH every time you execute thessh,scp, orsftpcommands on your terminal.
Example Output Explanation
This snippet sets up a secure connection to a production server on a non-standard port and configures a secondary GitHub key for work:
Host web-prod
HostName 203.0.113.45
User ubuntu
Port 2222
IdentityFile ~/.ssh/keys/prod_rsa
ServerAliveInterval 60
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/keys/github_work_ed25519Best Practices
- Use 'ServerAliveInterval 60' to keep your SSH connections from timing out and disconnecting when you step away from your keyboard or your NAT drops idle connections.
- Always organize your keys in a secure folder and reference them explicitly via 'IdentityFile' rather than relying on the SSH agent to blindly guess the right key during authentication.
- Put wildcard fallback hosts (like 'Host *') at the very bottom of the file. SSH reads the config top-down and applies the first matching rules.
Common Mistakes
- Forgetting to set strict file permissions. SSH will outright refuse to read the config file if permissions are too open. You MUST run 'chmod 600 ~/.ssh/config'.
- Using tabs instead of spaces for indentation. While some modern SSH versions allow tabs, 2 or 4 spaces are the universally supported standard.
- Typing '~' in paths on Windows. On Windows, you should generally provide the absolute path (e.g., C:/Users/Name/.ssh/key) to avoid path resolution errors.
Security Notes
- Never share your ~/.ssh/config file publicly (e.g., in a public dotfiles repository) if it contains sensitive internal IP addresses or server hostnames, as this provides a direct network roadmap for attackers.
- Consider adding 'ForwardAgent no' globally (under a 'Host *' block) to prevent rogue or compromised servers from hijacking your local SSH agent.
Testing Instructions
- Save the generated text to exactly '~/.ssh/config' on your Mac or Linux machine (no file extension).
- Ensure permissions are highly restricted: run 'chmod 600 ~/.ssh/config' in your terminal.
- Test the connection using your new memorable alias: 'ssh web-prod'. You should connect instantly without typing the IP or username.
Frequently Asked Questions
Does this file go on the remote server or my local computer?
Why does SSH say 'Bad owner or permissions'?
Can I use this ~/.ssh/config file on Windows?
How do I manage multiple GitHub accounts?
How We Keep Your Configs Safe & Valid
Built-in Error Checking
Every file is checked against official rules. We catch missing fields and bad syntax. YAML indentation errors are flagged right away. Kubernetes, Terraform, and Docker specs are all covered. API versions and labels are verified too. You get valid output every time you generate.
100% Private & Local
All tools run in your browser only. Your API keys never leave your machine. We do not use any tracking scripts. No data is sent to any server. Passwords and secrets stay on your device. Crypto operations use the Web Crypto API. Your privacy is fully protected at all times.
Secure Settings by Default
Configs use safe defaults out of the box. Containers run as non-root users. Root filesystems are set to read-only. Dangerous Linux capabilities are dropped. Network policies limit pod-to-pod traffic. TLS 1.3 is enabled for web servers. Security headers are added where needed.
Ready for CI/CD & Git
Output files are ready for your Git repo. Use them with ArgoCD, Flux, or GitHub Actions. Files use clear formatting and comments. Code review is easy for your team. Indentation and key order are consistent. Test in staging before going to production. Every file is clean and well-structured.
Infrastructure as Code
Store configs in Git alongside your code. Terraform modules include typed variables. Backend configs support remote state locking. Outputs work across multiple modules. Ansible playbooks use clear task steps. Chef and Puppet configs are also supported. Every file works with version control tools.
Monitoring & Tracing
Set up Prometheus with auto-discovery rules. Create Grafana dashboards with template variables. Add alerting rules with severity labels. Use OpenTelemetry for trace collection. Forward logs to Loki or Elasticsearch. Connect to Jaeger or Tempo for tracing. Monitor metrics, logs, and traces together.
Container & Docker Safety
Dockerfiles use multi-stage builds for small images. Base images are pinned to exact versions. Dev files are excluded from final images. Health checks are added for orchestrator use. Containers switch to non-root users. Docker Compose uses named volumes and networks. Resource limits are set in deploy configs.
Multiple Output Formats
Export as YAML, JSON, HCL, or TOML. Kubernetes uses YAML with proper separators. Terraform uses HCL with correct escaping. JSON output has consistent indentation. Copy to clipboard with one click. Preview output with syntax highlighting. Line numbers help you review quickly.