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

  • Home
  • SEARCH
  • 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 9239549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:00:57+00:00 2026-06-18T08:00:57+00:00

I’m trying to understand how the configurations under .ssh/config and .git/config interact. Here’s the

  • 0

I’m trying to understand how the configurations under .ssh/config and .git/config interact.

Here’s the situation: I have two separate github accounts, let’s call them GH0 and GH1, and I want to interact with both “passwordlessly”, i.e., using ssh keys in ~/.ssh/id_rsa.GH0.pub and ~/.ssh/id_rsa.GH1.pub. At the moment this works for GH0 but not for GH1. (E.g., push commands to GH1 die with ERROR: Repository not found.\nfatal: The remote end hung unexpectedly.; ssh -T git@github.com works, but only because it connects GH0.)

This means that for each of these github accounts I have to have a corresponding section in ~/.ssh/config, specifying which ssh key file to use for it. (E.g., the section for GH0 will have something like IdentityFile ~/.ssh/id_rsa.GH0, etc.)

The question is: what else do I have to put in each of these sections? More specifically,

what do I have to put as the argument to the Host keyword in ~/.ssh/config?

The information that I’ve found so far on this makes no sense to me. In some examples, I see stuff like

Host github.com
    Hostname github.com
    User git
    IdentityFile ~/.ssh/id_rsa

Host ac2.github.com
    Hostname github.com
    User git
    IdentityFile ~/.ssh/id_rsa_ac2

Where does that “ac2.” prefix in the second Host come from???

Where do I find the corresponding ones for my github accounts?

Some of the info I’ve found lead one to guess that arguments to the Host keyword are in fact arbitrary, implying that the following would be fine too

Host omgwtfbbq
    Hostname github.com
    User git
    IdentityFile ~/.ssh/GH0

Host 4.8.15.16.23.42
    Hostname github.com
    User git
    IdentityFile ~/.ssh/GH1

But if so, this raises yet another question: How does git (or github) know which of these two sections to use for any given command?

Again, I guess1 that this would be specified in the project’s .git/config file, under some [remote ...] section, but how?

1I must resort to guessing because, for one thing, I have not been able to find documentation for the interpretation of the key-value pairs in .git/config. The closest I’ve found is the man page for git-config, but I can’t find any documentation in this page for the url = ... field under a [remote ...] section. The man page for git-remote, too, has no documentation about this field.

  • 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-18T08:00:58+00:00Added an answer on June 18, 2026 at 8:00 am

    Do the following:

    $ git remote add omgwtfbbq git@omgwtfbbq:user/repo.git
    $ git pull omgwtfbbq master
    

    This will use the Host alias you’ve defined in your ~/.ssh/config as the git host, and thus will use the IdentityFile you’ve setup.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.