Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:29:15+00:00 2026-06-15T00:29:15+00:00

I am trying since more than 3 hours to setting up multiple account for

  • 0

I am trying since more than 3 hours to setting up multiple account for github and litteraly tired. I have tried out almost all possible way describe here, github and articles and none of them worked. I am completely newbie to github and Unix as well. So need your help to fix this. Here below what I am doing

I am using Windows 7 and have set two ssh key for two different accounts.

  1. id_rsa
  2. id_rsa_ac2

Than created config file in .ssh directory of the User and added below code

#Account one
Host github.com
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile /c/Projects/.ssh/id_rsa

#Account two
Host ac2.github.com
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile /c/Projects/.ssh/id_rsa_ac2

Now I am trying to add remote by using below code

git remote add origin git@ac2.github.com:myaccount/my.git

and push with bellow code

git push origin master

But when I am trying to push it is giving me Error:
Error: Permission to myaccount/my.git denied to {account}. // where it is considering default user account and not for ac2 user account
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Thanks a lot..

Additional Info:

I have test the id_rsa_ac2 and giving successfully authenticated message. But the strange thing is giving username with original account not with the ac2 account username

Hi {username!} You've successfully authenticated, but GitHub does not provide shell access. //here user id should be from ac2 but it is showing userid from id_rsa and not from id_rsa_ac2

INFORMATION: Final Code

@VonC’s answer worked and adding final code as my answer if anyone want to use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:29:17+00:00Added an answer on June 15, 2026 at 12:29 am

    For your config to be taken into account, you need to use its Host name in your remote address:

    git remote add origin ac2.github.com:myaccount/my
    

    If you have defined a HOME environment variable (which isn’t defined by default on Windows, but is defined if you are using the msysgit git-cmd.bat) to a directory under which you have your .ssh directory, with its id_rsa_ac2 private key, and id_rsa_ac2.pub public key, then it will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get SBT to build a project that could have more than
I have more than 10GB .csv files. I m trying to import the data
I've been trying for a few hours (probably more than I needed to) to
I have a dataset in wide form with more than 1500 columns. Since many
I am new to C# .NET. I have been trying since 2 days, but
I'm trying to play with inter-process communication and since I could not figure out
I'm trying to create a button with a rectangle since we're gonna have different
I'm trying to find out more about MySQL VIEW's, and I'm still quite confused
I am currently trying to deliver more than one implementation of an header file.
I have literally spent hours with JQuery trying to extract a piece of text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.