4

I'll be very detailed, as I followed the advice on a related question and it didn't work.

I'm on Mac OS X 10.7 trying to make two heroku accounts work. Let's call these accounts first and second

To start clean, I removed the keys in ~.ssh/, run heroku keys:remove on both accounts to get rid of existing keys, and run ssh-add -D to remove existing entries (in other words: ~.ssh/ is empty, except for known_hosts; heroku keys says I have no keys, and ssh-add -L says there are no entries.

I heroku login into the first account and I run these:

ssh-keygen -t rsa -C "first@example.com" -f  ~/.ssh/id_rsa_first
ssh-add ~/.ssh/id_rsa_first
heroku keys:add ~/.ssh/id_rsa_first.pub

then I heroku logout and heroku login into the second account and I run these:

ssh-keygen -t rsa -C "second@example.com" -f  ~/.ssh/id_rsa_second
ssh-add ~/.ssh/id_rsa_second
heroku keys:add ~/.ssh/id_rsa_second.pub

In both cases I note down the key fingerprints, which I'll call fingerprint_first and fingerprint_second.

Now I heroku login to first and git push heroku master works fine, then heroku login to second on a second app and git push heroku master fails, with the error

!  Your key with fingerprint fingerprint_first is not authorized to access second-app-name.

If I remove that from the ssh list with ssh-add -d ~/.ssh/id_rsa_first, then git push heroku master works on the second app, but now if I go back to the first app and heroku login to the first account, git push heroku master of course fails.

Please help :)

Community
  • 1
  • 1
Andrea
  • 420
  • 2
  • 8

2 Answers2

2

At the end, this answered it.

I restarted from scratch, removing all keys, and added David Dollar's plugin heroku-accounts

Now it works, and I don't even need to log out/in when I switch projects, as I can set a Heroku account on each project directory.

Andrea
  • 420
  • 2
  • 8
  • David's plugin now gets automatically uninstalled with the latest heroku cli `Uninstalling deprecated ddollar/heroku-accounts plugin... done` :( – mgPePe Oct 29 '15 at 18:37
  • 1
    Heroku have forked and taken over the project. https://github.com/heroku/heroku-accounts To install you'll need to follow the instructions above. Importantly you need to manually set the account to be in use. – jufemaiz Jun 27 '16 at 10:00
0

Similar problem had by another stackoverflow user;

Cannot push to Heroku because key fingerprint

As well as:

Why is my key w/ fingerprint not authorized when I try to push latest changes to Heroku?

Community
  • 1
  • 1
Dane Balia
  • 5,271
  • 5
  • 32
  • 57