SSH & Keys
Git SSH Config Generator
Build Your SSH Config
Step 1: Add Git Hosts
For each remote Git repository, enter a unique Host alias (e.g., github-work), the HostName (e.g., github.com), your SSH User (usually git), and the path to your IdentityFile (private key). You can add multiple hosts for different repos or services.
How to Use Your SSH Config for Git
- Place the generated
configfile in your~/.ssh/directory. - Set correct permissions:
chmod 600 ~/.ssh/config - Use the Host alias in your git remote URL, e.g.,
git@github-work:username/repo.git - Each host entry can use a different SSH key for different GitHub, GitLab, Bitbucket, or private servers.
- Never share your private keys. Keep your
.ssh/configand keys secure.
Frequently Asked Questions
The .ssh/config file lets you define settings for connecting to remote servers via SSH, including aliases, keys, and options. For Git, it helps you manage multiple accounts or keys easily.
Add a Host entry for each remote (e.g., github-work, github-personal) with its own IdentityFile. Use the Host alias in your git remote URL instead of the actual hostname.
Yes. All config generation happens in your browser. No data is sent or stored anywhere. Your SSH keys and configuration remain completely private.
Set permissions to 600: chmod 600 ~/.ssh/config. This keeps your config private and secure.
Yes! You can add multiple Host entries for different Git hosting services. Each can use a different SSH key for different accounts.
Tool features
Guided configuration
Multiple hosts
Per-account keys
Runs in your browser
What ~/.ssh/config does & how host aliases work
Git identifies you by SSH key, not by username — so the moment you have a work account and a personal account on the same host, you have a problem. Both want to reach git@github.com, and SSH will offer the same default key to both. The server sees one identity and pushes land under the wrong account.
A ~/.ssh/config file fixes this with host aliases. You invent a name like github-work, point it at the real HostName github.com, and pin a specific IdentityFile to it. Clone using the alias — git@github-work:org/repo.git — and SSH picks the right key every time, with no flags to remember.
github-work. Purely local — it does not have to resolve in DNS.github.com.git, regardless of your account name.~/.ssh/id_ed25519_work.How to use this tool
github-work, gitlab-personal — rather than the bare hostname, so the two never collide.HostName to the actual server (github.com), leave User as git for Git hosting, and set IdentityFile to the private key for that account.~/.ssh/config, then run chmod 600 ~/.ssh/config. SSH ignores a config file that other users can write to.git clone git@github-work:org/repo.git, or repoint an existing repo with git remote set-url origin git@github-work:org/repo.git.Frequently asked questions
~/.ssh/config on macOS and Linux, and C:\Users\<you>\.ssh\config on Windows. Run chmod 600 ~/.ssh/config after saving — SSH ignores a config file that is writable by other users, usually without saying why.git remote -v: it needs to read git@github-work:org/repo.git, not git@github.com:.... Another common cause is ssh-agent offering a different key first — ssh -T git@github-work will tell you which identity the server actually sees.git — your identity comes from the key, not the username. Setting it to your account name is a common mistake and causes an immediate authentication failure.Host line is a local label that only your SSH client sees, so github-work or client-a is fine. The HostName line is the one that must be a real, resolvable address.ssh -T git@your-alias — GitHub and GitLab both answer with the account name the key maps to, which is the quickest way to confirm the right key is being offered. Add -v to see exactly which identity files SSH tried.~/.ssh/id_ed25519_work. Your actual private key is not involved.