I've created a new ssh key, added it to my ssh keys locally, then added it to heroku. When I try to push, I get a 'not authorized' error. I'm not sure what to do next...
~/app> heroku keys:add /home/user/.ssh/XXX-YYY-ZZZ.pub
Uploading SSH public key /home/user/.ssh/XXX-YYY-ZZZ.pub... done
~/app> heroku keys
=== mail+heroku#mydomain.com Keys
ssh-rsa xxxx zzz#ubuntu
ssh-rsa yyyy zzz#ubuntu
~/app> ssh-add /home/user/.ssh/XXX-YYY-ZZZ
\Enter passphrase for /home/user/.ssh/XXX-YYY-ZZZ:
Identity added: /home/user/.ssh/XXX-YYY-ZZZ (/home/user/.ssh/XXX-YYY-ZZZ)
~/app> git push heroku master
! Your key with fingerprint XXXXX is not authorized to access XXX-YYY-ZZZ.
fatal: The remote end hung up unexpectedly
Do I have to connect that key to my XXX-YYY-ZZZ app somehow? I don't see anything about that in the docs here https://devcenter.heroku.com/articles/keys.
May be related, I have two heroku accts that I'm deploying to, this one that's failing is the second one. I'd like to keep them separate. I suspect the issue is with my ssh_config but I'm not sure how to solve it yet.
Looks like there's a plugin for heroku that will deal with this:
https://github.com/ddollar/heroku-accounts
Related
I went through the tutorial in here https://devcenter.heroku.com/articles/python and then I changed the remote address of git to the one in one of the apps in my dashboard in Heroku. But then after, when I try to push to master, I get
git push heroku master
! Your key with fingerprint 55:55:55:55:55:55 is not authorized to access damp-garden-2012.
fatal: The remote end hung up unexpectedly
I tried ssh-add -d and that didn't work
edit: when i do ssh-add -D and then ssh-add -l I still get:
2048 33:33:33:33:33:33:33 one#email.com (RSA)
2048 44:44:44:44:44:44:44 different#email.com (RSA)
You can check what keys Heroku has via heroku keys, to add a new key use heroku keys:add. More info on managing keys can be found at https://devcenter.heroku.com/articles/keys
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:
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
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
I'm new to heroku. I uploaded my rsa key and then tried pulling the starter code for a Facebook app that I'm trying to make but when I use the git clone command, I keep on getting the message fatal:
The remote end hung up unexpectedly.
What could be the possible reasons for this message to turn up. I have verified that my rsa key exists on the heroku server by using the command heroku keys and it did return the same key which I had created.
try this
heroku keys:add
i added the keys and then did the whole process of git phush again and it worked fine for me
hope this helps
Details at "Managing Your SSH Keys": https://devcenter.heroku.com/articles/keys
I'm not sure what's wrong with my heroku account, but I'm no longer able to clone my heroku project.
NOTE : Please do not close this question considering as duplicate question of this
as I have described below that I tried all solutions mentioned in the answers to that question
! Your key with fingerprint XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX is not authorized to access genqr
Whenever I do
git clone git#heroku.com:genqr.git
I have done everything humanly possible.
1. I have deleted all my keys of heroku added a new key
using
heroku keys:remove
and
heroku keys:add /home/vire2egi/.ssh/setup.pub
Still, the same problem when cloning the project happens.
2. I also added heroku key to ssh-add
ssh-add /home/vire2egi/.ssh/setup
3. Also added key to keychain
eval `keychain --eval setup`
All the above commands result in success but still I can't clone the repo
4. I also did
heroku keys:remove
heroku auth:logout
heroku auth:login ## Authenticated myself and then added the key: still no success
Still no success
5. I also defined a config for heroku, something like
Host heroku.com
Hostname heroku.com
User viren2egi
IdentityFile /home/vire2egi/.ssh/setup
Still no success.
6. Out of fustration I created a brand new key.
ssh-keygen -t rsa
And repeated all the above set for that key too, but still I get the same problem.
I also cleaned my known_hosts everytime I ran anyone of the above commands just to make sure it does not pick from it.
Note :
Whenever I tried heroku:keys, it always presented me with the correct information of the key that I have added
Can anyone help me?
When you do a git operation it uses any ssh keys you have loaded locally in some order (I believe the order in which they were loaded). It may be that you have an old key still loaded and when you do a git operation it tries that key first and fails and does not go on to the next key if there's a failure.
So... try unloading all your ssh-keys with ssh-add -D, then loading the most recent key you created and added to heroku:
$ ssh-add -D
$ ssh-add /home/vire2egi/.ssh/setup
$ git clone git#heroku.com:genqr.git
???
I had the same problem. The steps described in http://rakshasingh.weebly.com/1/post/2013/04/accessing-multiple-heroku-accounts-from-one-machine.html helped me well. Last part about cloning from existing heroku app is important.
i often need to switch heroku accounts and use a script which does the following:
heroku keys:clear && rm ~/.heroku/credentials && heroku list
after which i need to enter my credentials for the account i want to switch to:
Enter your Heroku credentials.
Email: fake#gmail.com
Password:
Uploading ssh public key /Users/fake/.ssh/id_rsa.pub
! Fingerprint already exists. Please use one ssh key per Heroku account
unfortunatelly i canĀ“t get passed this error.
any help much appreciated.
remove the heroku credentials
rm ~/.heroku/credentials
And then upload the key manually
heroku keys:add ~/.ssh/otheraccount.pub
Enter your Heroku credentials and thats it!!
Dont use the same ssh key for mutiple accounts. Please use one ssh key for one account.
For more info to fix this problem you can refer to http://martyhaught.com/articles/2010/12/14/managing-multiple-heroku-accounts/
strangely enough i could solve the problem with:
clearing the keys, deleting credentials switching to other accounts and back again.