在heroku上管理多个ssh密钥 [英] managing multiple ssh keys on heroku
问题描述
所以我有几个用于其他帐户的ssh密钥。我现在需要能够在我的计算机上克隆一个heroku存储库。我创建了一个新的ssh密钥,并使用了heroku密钥:add添加到我的heroku帐户。但是,当我尝试克隆存储库时,出现以下错误:
您的指纹密钥:....未被授权访问农村景象。致命:远程终端意外挂断
我听说我需要在.ssh文件夹中创建一个配置文件,但是我不知道该把什么放进去。
任何帮助将非常感谢!
我有时必须使用一堆heroku帐户,并且遇到了这个问题。以下是我通常所做的:
-
清除身份
$ ssh-add -D
-
添加当前帐户所需的密钥
$ ssh-add〜/ .ssh / an_account_key
-
现在,我可以推送到我的heroku应用程序中
$ git push heroku-remote master
当然,这个假设已经将密钥添加到了heroku帐户。你可以这样做:
$ heroku keys:add
解决这个问题的正确方法是使用〜/ .ssh / config 中的SSH配置,但这对我来说有点多了,因为我只是偶尔切换帐户。
使用SSH配置文件搜索会产生很多结果,但以下是一些可能的帮助:
- SSH配置 - 相同的主机,但不同的密钥和用户名
- 为给定域名的git推送指定SSH密钥
Clear identities
$ ssh-add -D
ssh-add the key that I need for the current account
$ ssh-add ~/.ssh/an_account_key
Now I can push to my heroku app
$ git push heroku-remote master
/ ul>
so I have a couple of ssh keys that are used for other accounts that I have. I now need to be able to clone a heroku repository on my computer. I created a new ssh key and used heroku keys:add to add it to my heroku account. However when I try and clone the repository I get this error:
Your key with fingerprint: .... is not authorized to access rural-visions. fatal: the remote end hung up unexpectedly
I've heard that I need to create a config file in the .ssh folder, but I don't know what to put into there.
Any help would be really appreciated!
I sometimes have to work with a bunch of heroku accounts, and have run into this. Here's what I usually do:
Of course, this assumes that the key has been added to the heroku account already. You can do that with:
$ heroku keys:add
The correct way to solve this is with an SSH configuration in ~/.ssh/config, but that's a bit much for me since I only switch accounts occasionally.
Googling about the SSH configuration file should turn up plenty of results, but here's some that might help:
- SSH config - same host but different keys and usernames
- Specify an SSH key for git push for a given domain
- Simplify Your Life With an SSH Config File
这篇关于在heroku上管理多个ssh密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!