Article
Configuring Multiple GitHub Accounts in Windows Using SSH
A practical guide to keeping personal and work GitHub accounts side by side on Windows with separate SSH keys.
Introduction
It is common for a developer to have at least two GitHub accounts, one personal and one for work. Here is a straightforward way to make both work side by side on Windows.
First navigate to:
C:\Users\<user-name>\.ssh
Check whether you already have SSH keys there. If you do not, the folder looks like this:
.ssh
├── known_hosts
└── known_hosts.old
Now let us generate two SSH keys.
| Account type | GitHub username | Email | | --- | --- | --- | | Personal | naveen | naveen@gmail.com | | Work | codeandcloud | naveen@codeand.cloud |
This example uses Ed25519 keys.
Generating SSH keys
Open Git Bash and run:
ssh-keygen -t ed25519 -C "naveen@gmail.com"
You will be prompted for:
- The file to save the key
- A passphrase
In this example, the personal key is saved as id_personal and the work key as id_work.
~/.ssh$ ssh-keygen -t ed25519 -C "naveen@gmail.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/____/.ssh/id_ed25519): id_personal
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_personal
Your public key has been saved in id_personal.pub
Create the work key in the same way:
~/.ssh$ ssh-keygen -t ed25519 -C "naveen@codeand.cloud"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/____/.ssh/id_ed25519): id_work
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_work
Your public key has been saved in id_work.pub
Adding SSH keys to the agent
Start the SSH agent:
eval "$(ssh-agent -s)"
Then add the identities:
ssh-add id_personal
ssh-add id_work
The terminal will look like this:
~/.ssh$ eval "$(ssh-agent -s)"
Agent pid 3350
~/.ssh$ ssh-add id_personal
Identity added: id_personal (naveen@gmail.com)
~/.ssh$ ssh-add id_work
Identity added: id_work (naveen@codeand.cloud)
Adding the SSH keys to GitHub
Copy the public key:
cat id_personal.pub
Then go to GitHub and add the key in SSH and GPG keys.
Configuring SSH for multiple accounts
Create a config file in .ssh and save:
# Personal GitHub
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_personal
# Work GitHub
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_work
Testing the keys
ssh -T git@github-personal
ssh -T git@github-work
If everything works, GitHub will confirm that you authenticated successfully.
Using different accounts for different repositories
If you have a repository named hello-world in the codeandcloud account, clone it like this:
git clone git@github-work:codeandcloud/hello-world.git
The only difference is replacing git@github.com with the host alias you configured.
Happy coding.
Related articles
Keep reading
Oct 26, 2026
Set Up the Google Analytics MCP Server in Claude Code on Windows and macOS
Connect Google's official Analytics MCP server to Claude Code with your own OAuth client and Application Default Credentials, so you can query GA4 data from the terminal.
Oct 1, 2026
Create a Google Cloud Project for Claude Connectors
Set up one dedicated Google Cloud project to own the APIs, OAuth client, and quota for the Google MCP servers you connect to Claude.
May 5, 2020
Integrating ESLint to VS Code
A quick walkthrough for setting up ESLint in VS Code for JavaScript or TypeScript projects.