Docs: Add instructions for how to configure `git` to use an ssh key without `ssh-agent`
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Label this issue](https://contributors.gitlab.com/manage-issue?action=label&projectId=278964&issueIid=576876) - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=576876) </details> <!--IssueSummary end--> <!-- * Use this issue template for suggesting new docs or updates to existing docs. Note: Doc work as part of feature development is covered in the Feature Request template. * For issues related to features of the docs.gitlab.com site, see https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/issues * For information about documentation content and process, see https://docs.gitlab.com/development/documentation/ --> - [x] Start this issue's title with `Docs:` or `Docs feedback:`. ## Problem to solve <!-- Include the following detail as necessary: * What product or feature(s) affected? * What docs or doc section affected? Include links or paths. * Is there a problem with a specific document, or a feature/process that's not addressed sufficiently in docs? * Any other ideas or requests? --> Doc Section Affected: (User/SSH/Generate An SSH Key Pair)[https://docs.gitlab.com/user/ssh/#generate-an-ssh-key-pair] In the codebase: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/ssh.md#generate-an-ssh-key-pair The process that's not addressed sufficiently: If a user wants to use git with an ssh key, but does not have the admin privileges to run `ssh-agent`. Currently, the docs do not address the above process and assumes the user is able to run `ssh-agent`, which may not always be the case. ## Further details <!-- * Any concepts, procedures, reference info we could add to make it easier to successfully use GitLab? * Include use cases, benefits, and/or goals for this work. * If adding content: What audience is it intended for? (What roles and scenarios?) For ideas, see personas at https://handbook.gitlab.com/handbook/product/personas/ or the persona labels at https://gitlab.com/groups/gitlab-org/-/labels?subscribed=&search=persona%3A --> Usecase: Users do not have admin privileges on their operating system, but still want to serve/use their ssh key with git. References: `git config` option [`core.sshCommand`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresshCommand) ## Proposal <!-- Further specifics for how can we solve the problem. --> Add a section in docs for how users can configure git to use `core.sshCommand` if they do not have the privileges to run `ssh-agent`. Something like so: ``` ### Configure Git to use an SSH key without administrative privileges If you do not have sufficient privileges to run `ssh-agent`, you may not be able to serve your SSH key such that git recognizes your SSH key. In such a case, you can still configure git to use a particular SSH key. This can be done with the `git config` option [`core.sshCommand`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresshCommand), like so: `git config --global core.sshCommand "ssh -i <path/to/ssh_private_key>"`. E.g. ```bash git config --global core.sshCommand = "ssh -i ~/.ssh/id_ed25519" ``` ``` ## Who can address the issue <!-- What if any special expertise is required to resolve this issue? --> No special expertise required ## Other links/references <!-- For example, related GitLab issues/MRs --> N/A /label ~"documentation" /label ~"docs-only" /label ~"type::maintenance" ~"maintenance::refactor" /milestone %Backlog
issue