Last updated Feb 28, 2025

Use Multiple GitHub Accounts on Windows 11 with SSH (Step-by-Step)

Manage multiple GitHub accounts on Windows 11 using SSH. Follow this guide to set up keys and switch accounts without conflicts.

Use Multiple GitHub Accounts on Windows 11 with SSH (Step-by-Step)

If you're a freelancer or a developer working with multiple clients, you might need to manage different GitHub accounts on your Windows 11 system. But how do you switch between them easily without getting into a login/logout mess?

The solution is SSH keys! 🎉 This guide will walk you through the process of setting up multiple GitHub accounts on Windows 11 using SSH in a simple and easy way.

Let’s get started! 🔥

Configuring SSH for Multiple GitHub Accounts on Windows 11

Managing multiple GitHub accounts on a single machine can get tricky, especially when pushing or pulling code from different repositories.

In this section, you'll learn how to configure SSH keys to securely connect and switch between multiple GitHub accounts on your Windows 11 system.

This setup ensures smooth workflow management without repeated login issues or permission conflicts.

Prerequisites

INFO

Before You Begin

Ensure you have the following set up on your Windows 11 system.

Required Software

  • Git for Windows
  • Windows Terminal (recommended)
  • Text editor (VS Code, Notepad++)

GitHub Accounts

  • Personal GitHub account
  • Work/Organization account
  • Access to both accounts

Step 1:Generate SSH Keys for Each Account

We'll create separate SSH keys for each GitHub account to maintain security and organization.

For Your Personal Account:

Run the following command (replace your-personal-email@example.com with your GitHub email):

ssh-keygen -t rsa -b 4096 -C "your-personal-email@gmail.com" 

For Your Work Account:

ssh-keygen -t rsa -b 4096 -C "your-work-email@company.com"

After entering the passphrase, the key is stored in the designated location, generating two files as shown below.

Now, you have two SSH keys: 📌 id_rsa (for your main GitHub account) 📌 id_rsa_client (for the new client’s GitHub account)

Make sure not to overwrite the existing key for your default personal account. When prompted, save the file with a unique name, such as id_rsa_COMPANY.

One file is the public key, and the other is the private key. You'll need this key to connect with your GitHub account. To view its contents, use the following command.

cat .ssh/id_rsa_work.pub

Make sure to copy and save the key in a text file on your computer, as it will be required for adding it to your second GitHub account.

Step 2: Add SSH Keys to GitHub Accounts

Copy Your Public Keys

# For personal account 
cat ~/.ssh/id_rsa_personal.pub 
# For work account 
cat ~/.ssh/id_rsa_work.pub

Add Keys to GitHub:

  1. Copy the output.
  2. Go to GitHub → Settings → SSH and GPG keys.
  3. Click New SSH Key, paste the key, and save.

Step 3: Configure SSH Config File

Create or edit the SSH config file to manage multiple accounts seamlessly.

Create/Edit SSH Config:

nano ~/.ssh/config

Add the Following Configuration:

# Default GitHub Account
Host github.com-main
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa

# Client GitHub Account
Host github.com-client
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_client

Step 4: Clone Repositories Using Different Accounts

Now, when cloning repositories, use the appropriate Host name.

Personal Repository:

git clone git@github.com-main:your-username/repo-name.git

Work Repository:

git clone git@github.com-client:client-username/repo-name.git

For pushing code, Git will automatically use the correct SSH key

Configure Local Git Settings:

For Personal Projects:  

cd personal-repo 
git config user.name "Your Personal Name" 
git config user.email "personal@email.com"

For Work Projects:  

cd work-repo 
git config user.name "Your Work Name" 
git config user.email "work@company.com"

Conclusion

You've successfully set up multiple GitHub accounts on Windows 11 using SSH keys. You can now seamlessly switch between personal and work projects without authentication hassles.

If you found this guide helpful, don’t forget to share it with your developer friends!

Happy coding!

Official Documentation

Tags

Available for projectsLet’s build together

Need this built properly,
not just explained?

I take on Angular and NestJS work directly — auth systems, multi-tenant SaaS, API rewrites and the deploy pipeline underneath them. You talk to the person writing the code.

Projects delivered
20+ Projects delivered
Angular • NestJS
7+ years Angular • NestJS
Average reply time
1 day Average reply time

What I can help with

  • Auth and permissions systems
  • Multi-tenant SaaS foundations
  • API design and rewrites
  • Deploy pipelines and VPS setup
  • Bug fixing and performance optimization
Send me a message

Tell me about your project and I’ll get back with a realistic scope and price.

Turn
Your Ideas
Into Reality

Stay in the loop

Get the finished tutorials, projects and resources in your inbox.

Join 5,000+ developers and get new tutorials, source code, product updates and exclusive content — straight to your inbox.

  • No spam
  • Useful content only
  • Unsubscribe anytime

Subscribe to TutsCoder

Be the first to get new tutorials, projects and tips.

Join 5,000+ developers already learning with us.

Learn
Build
Grow

Discussion

0 comments

Share your thoughts, ask questions or suggest improvements. Let’s learn and grow together!

No comments yet — be the first to start the discussion.

Join the discussion

Sign in to join the discussion. Your account also keeps your saved tutorials and path progress.