Sourcetree Generate Ssh Key Github
16.12.2020 admin
- Status:Needs Triage(View Workflow)
- Resolution: Unresolved
- Fix Version/s: None
- Labels:
- Environment:
SourceTree 設定からSSH設定&リポジトリをcloneするまでの流れ. 今回はSourceTree 設定からSSH設定&リポジトリをcloneするまでの流れを解説していきたいと思います。 必要なもの. To generate an SSH Key, select Tools Create or Import SSH Keys. This window should pop up: 2. Click Generate, and move the mouse randomly until a key is generated: 3. A public key and a private key should appear. Save them both by clicking Save public key (save as.pub filetype), and Save private key (save as.ppk filetype): 4.
/microsoft-office-professional-plus-2010-product-key-generator.html. First issue..
I set up a remote account to GitHub using OAuth and SSH. I created a new SSH key and enabled the checkbox to allow SourceTree to modify my SSH configuration.
When I attempted to Clone a repo, the clone window opened but there was an Error message of 'This is not a valid source path / URL'. Clicking on the message shows the connection log with the following.
/Users/USERNAME/.ssh/config: line 97: Bad configuration option: usekeychain
/Users/USERNAME/.ssh/config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.
I opened /Users/USERNAME/.ssh/config file and found the following new entry
# — SourceTree Generated ---
Host InsomniacSoftware-GitHub
HostName github.com
User InsomniacSoftware
PreferredAuthentications publickey
IdentityFile /Users/USERNAME/.ssh/InsomniacSoftware-GitHub
UseKeychain yes
AddKeysToAgent yes
# ----------------------------
Commented out the UseKeychain line and saved. Back in SourceTree, clicked on the Clone link and it successfully logged into GitHub.
After some testing, I discovered the error is due to using a non-Apple version of ssh that doesn't support the UseKeychain option. I have installed OpenSSH_7.5p1 (OpenSSL 1.0.2l 25 May 2017) via Homebrew at /usr/local/bin/ssh. This is the version SourceTree is using since it is the first in $PATH.
To make it work with either version of ssh, at the top of the ~/.ssh/config file, add the following lines
Host *
IgnoreUnknown UseKeychain
This will cause non-Apple versions of ssh to ignore the UseKeychain option.
Second issue..
My system-wide ssh config file enables StrictHostKeyChecking by default (enforced by IT/Security department). SourceTree is unable to connect (Permission denied (publickey)) unless I create a 'Host github.com' entry in my personal ssh config file that disables StrictHostKeyChecking or points to a Known Hosts file that already contains github.com's public key.
Note: Adding these options to the SourceTree-Generated lines does not work as ssh isn't actually using those options (Host doesn't match, User should always be git, etc). SRCTREE-4631 discusses this a bit.
So that a user doesn't have to create a 'Host github.com' entry, SourceTree should always call git with the GIT_SSH_COMMAND variable setting these options, like this.
GIT_SSH_COMMAND='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=/Users/USERNAME/.ssh/STGENERATEDKEY' git clone git@github.com ..
Now for the request.
When I was setting up the GitHub account, the SSH Key line was showing the default id_rsa.pub key. Clicking on the Copy To Clipboard button would bring up the Generate SSH Key dialog. The icon said to hold down Option key to generate a new key but the Generate SSH Key dialog would appear whether I was holding down Option or not, so it couldn't use my id_rsa key either. I generated a new SSH key which SourceTree saved as InsomniacSoftware-GitHub[.pub].
Github Ssh Key Generation
However, I already have a SSH key uploaded to GitHub that I'm using for other git applications, which is different from the default id_rsa.pub key. Unfortunately there is no way in the dialog window to tell SourceTree to select a different key.
Request: Allow the user to pick an existing key instead of forcing them to generate a new key.
Sourcetree Generate Ssh Key Github Tutorial
- Votes:
- 0Vote for this issue
- Watchers:
- 2Start watching this issue