Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Improve experience with local SSH keys #3835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 12, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Sep 2, 2022

This change means that users can place SSH keys in the default locations for OpenSSH, like ~/.ssh/id_rsa and it will be automatically picked up (as per a default OpenSSH experience).

Fixes #3126

Notes:

  • I wanted to implement a -test.homedir flag to test the SSH fallback key locations, however, setting HOME=/tmp/ seems to have no effect on where OpenSSH looks for the config :(
  • Although this fixes Cannot bring your own SSH key to clone #3126, we'll want to break out some Windows related discussions from there to:
    1. Fix SSH agent forwarding on Windows
    2. Potentially refactor this into using our own proxy agent, once our Windows SSH agent story is fixed

@mafredri mafredri self-assigned this Sep 2, 2022
@mafredri mafredri requested a review from a team September 2, 2022 14:15
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL ssh -g

cli/gitssh.go Outdated
"identityfile ~/.ssh/id_xmss",
}, "\n")

// praseIdentityFilesForHost uses ssh -G to discern what SSH keys have
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// praseIdentityFilesForHost uses ssh -G to discern what SSH keys have
// parseIdentityFilesForHost uses ssh -G to discern what SSH keys have

mafredri and others added 7 commits September 5, 2022 12:44
This change means that users can place SSH keys in the default locations
for OpenSSH, like `~/.ssh/id_rsa` and it will be automatically picked
up (as per a default OpenSSH experience).

Fixes #3126
@mafredri mafredri force-pushed the mafredri/bring-your-own-ssh-keys branch from 3ef314f to 0d413fb Compare September 5, 2022 09:47
@mafredri mafredri merged commit d0b02e5 into main Sep 12, 2022
@mafredri mafredri deleted the mafredri/bring-your-own-ssh-keys branch September 12, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot bring your own SSH key to clone
2 participants