Home | Edit | New

Guides: Addressing authentication problems with SSH feed

If your github authentication information is different from your machine account information, you’ll need to modify your ssh configuration file.

On OSX (and nix systems), create or open the file at:

~/.ssh/config
Add the following lines:
Host github.com
    User git
    Hostname github.com
    IdentityFile [local path to private key half of github public key you provided]

You should be aware of the environment variable GIT_SSH, which is used by git to find your ssh-speaking client, if ssh doesn’t work for you.

If you’re on a windows configuration, especially cygwin-git+pageant+putty/plink, you might want to set GIT_SSH to your plink.exe location—unless that doesn’t work for you. In certain circumstances (perhaps after a service pack installation), you will find git network operations failing with
FATAL ERROR: Disconnected: No supported authentication methods available
this is because plink.exe running from your (cygwin-provided) git command can’t talk with pageant to get its keys . A solution is to set up a script that has:
/cygdrive/c/ntnot/plink.exe -i "c:\users\you\.ssh\key-file-for-github.ppk" $1 $2
and set GIT_SSH to point to this. This explicitly provides the key for plink to use, rather than have it talk with pageant.
Last edited by defunkt, about 20 hours ago
Versions: