Setting a custom path for git private SSH key on linux

后端 未结 5 1393
春和景丽
春和景丽 2021-01-30 17:19

I\'m trying to setup a git client on linux. I uploaded my private key to the machine, and I understand that I should put it in ~/.ssh, but I don\'t have access to that folder.

5条回答
  •  攒了一身酷
    2021-01-30 17:52

    I would have said put the file name in ~/.ssh/config, but you likely would not have access to this file, too.

    You can give ssh the private key to use with the -i keyfile option.

    Now how to say git which options to pass to ssh?

    The GitTips page says create a wrapper script and point to it with the GIT_SSH environment variable.

    It looks like you also can use the git configuration core.gitProxy, but I did not find a good example and some mailing list message suggests it is only for the git: protocol.

提交回复
热议问题