Git: 如何为给定的存储库设置非标准的 SSH 私钥路径
Git: how to set not standard private SSH key path for a given repository
我在通过 SSH 推送到我的 Gitlab 帐户时遇到问题,因为我将密钥对移到了不同的文件夹中。
因此,在推送远程后,我收到“访问被拒绝”错误,我认为这与 ssh 尝试在 .ssh 文件夹中使用标准 id_rsa 这一事实有关。
Here, I found a way to clone repo using non-standard path to the private SSH key. Now I want to make it default for a given repo using (from Git-scm):
git config core.sshCommand='ssh -i path/to/the/key/privatkeyfilename'
我收到错误:
invalid key: core.sshCommand=ssh -i path/to/the/key/privatkeyfilename
我是不是做错了什么?如何实现?
我想你删除了 =
。您可以使用以下更正。
git config core.sshCommand 'ssh -i path/to/the/key/privatkeyfilename'
我在通过 SSH 推送到我的 Gitlab 帐户时遇到问题,因为我将密钥对移到了不同的文件夹中。
因此,在推送远程后,我收到“访问被拒绝”错误,我认为这与 ssh 尝试在 .ssh 文件夹中使用标准 id_rsa 这一事实有关。
Here, I found a way to clone repo using non-standard path to the private SSH key. Now I want to make it default for a given repo using (from Git-scm):
git config core.sshCommand='ssh -i path/to/the/key/privatkeyfilename'
我收到错误:
invalid key: core.sshCommand=ssh -i path/to/the/key/privatkeyfilename
我是不是做错了什么?如何实现?
我想你删除了 =
。您可以使用以下更正。
git config core.sshCommand 'ssh -i path/to/the/key/privatkeyfilename'