在Linux上为git私有SSH密钥设置自定义路径 [英] Setting a custom path for git private SSH key on linux

查看:514
本文介绍了在Linux上为git私有SSH密钥设置自定义路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Linux上设置git客户端.我将我的私钥上传到了机器上,并且我知道应该将它放在〜/.ssh中,但是我无权访问该文件夹.

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.

如何告诉git在其他地方寻找私钥?

How can I tell git to look for the private key somewhere else?

推荐答案

一种选择是使用ssh-agent并将文件名提供给ssh-add.

One option is to use ssh-agent and provide a file name to ssh-add.

例如:

$ ssh-agent /bin/bash
$ ssh-add ~/mykeys/id_rsa

这篇关于在Linux上为git私有SSH密钥设置自定义路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆