Where does GitHub for Windows keep its SSH key?
Asked Answered
K

5

85

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?

Kadner answered 26/11, 2013 at 19:25 Comment(2)
This was quite a long time ago; the behaviour of the current GitHub Desktop software may be different.Kadner
I've updated the link to point to the Wayback Machine copy of the GitHub for Windows help page I linked as the original is gone.Kadner
D
116

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

Dellora answered 26/1, 2014 at 4:53 Comment(3)
On my computer it was in that folder but it was called github_rsa and had the paired github_rsa.pub with it.Zagazig
This is public key. SSH/GIT uses private one to authorize.Bacchae
where is it now in 2020Betancourt
B
32

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.

Bulrush answered 8/7, 2014 at 12:26 Comment(1)
In our company, UserProfile is completely different from HomeDrive+Path, and UserProfile leads to the correct folder where GIT stores its .ssh folder.Spindry
A
15

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.

Axes answered 30/5, 2014 at 21:32 Comment(0)
K
5

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.

Kadner answered 26/11, 2013 at 19:34 Comment(0)
K
1

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

Karajan answered 30/10, 2018 at 9:58 Comment(1)
Isn't there a shorter form? Something like %USERPROFILE%\AppData\Roaming\SPB_Data\.ssh? Or even shorter, like %APPDATA%\SPB_Data\.ssh?Velez

© 2022 - 2024 — McMap. All rights reserved.