Where does GitHub for Windows keep its SSH key?

Windows 7Ssh KeysGithub for-Windows

Windows 7 Problem Overview


GitHub distributes a simplified Git client for Windows they call GitHub for Windows; it authenticates via GitHub account, and although it usually uses HTTPS remotes for local repositories it creates, if you tell it to use an existing local repository that has an SSH remote on GitHub, it will use your GitHub credentials to set up an SSH key on the GitHub account for itself. But where does it keep the SSH key in the filesystem?

Windows 7 Solutions


Solution 1 - Windows 7

%HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub is where the key is.

Solution 2 - Windows 7

On my work PC it is in %USERPROFILE%/.ssh/ and not %HOMEDRIVE%%HOMEPATH%/.ssh/.

On many computers those folders are the same location, but it depends on the configuration. So it seems %USERPROFILE% is the location used by GitHub for Windows, which is also the ~ home location for its Git Bash.

This is confusing since my Windows Git default installation uses %HOMEDRIVE%%HOMEPATH% as its ~ home location.

Solution 3 - Windows 7

The default location is: %HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub. That would expand to something like C:\Users\dennis\.ssh\id_rsa.pub.

If %HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub already exists, GitHub creates a key named github_rsa(.pub) in the same folder.

Solution 4 - Windows 7

It's in %HOMEDRIVE%%HOMEPATH%\.ssh.

Note that GitHub for Windows normally uses SSL; SSH keys won't have been created unless you've used an SSH repository with it at some point.

Solution 5 - Windows 7

On my Windows 10 Home the .ssh folder's path is %HOMEDRIVE%%HOMEPATH%\AppData\Roaming\SPB_Data\.ssh

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionraksliceView Question on Stackoverflow
Solution 1 - Windows 7neuro_tarunView Answer on Stackoverflow
Solution 2 - Windows 7t3hmunView Answer on Stackoverflow
Solution 3 - Windows 7Dennis van der SchagtView Answer on Stackoverflow
Solution 4 - Windows 7raksliceView Answer on Stackoverflow
Solution 5 - Windows 7runovskyiView Answer on Stackoverflow