github - 便携版git(即安装在U盘上的版本)如何设置ssh私钥?
淡淡烟草味
淡淡烟草味 2017-05-02 09:43:52
0
1
1123

便携版的git是即插即用的,可以在任意一台没有安装git的电脑上使用。如果采用和桌面版git相同的方法设置ssh私钥,是无法正常使用ssh访问github远程仓库的,即使我将私钥保存在U盘上。下面是错误信息:

The authenticity of host 'github.com (192.30.253.112)' can't be
established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of know
n hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我想知道如何在便携版的git如何设置ssh私钥才能保证我正常连接远程仓库。

淡淡烟草味
淡淡烟草味

全部回复(1)
黄舟

我根据git移动版中的readme文件找到了配置方法。其实方法很简单,配置步骤和桌面版git配置ssh-key的方法基本一样,只是其中选择密钥的存放路径这一步有所不同——不要回车使用默认路径,要将路径改为U盘中移动版git的路径(如g:\git_portable\.ssh)。然后,每次使用git(移动版)的时候,先使用export HOME=g:\git_portable临时修改HOME环境变量,其中后面的移动版git的安装路径要根据你的实际情况设置。
这样你就可以像在桌面版git中一样,来使用ssh来访问你的github远程仓库了。
注意,不要忽略上面路径中的的双斜杠\。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!