I don´t know what I did , but for me its now a real mess. Im trying to push my rails app code to heroku with
git push heroku master
and this ERROR come up:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
ok, now i wil try to fix it making a new ssh key
sudo ssh-keygen -t rsa
I press enter three times and then my ssh key is created , OK.
But now when i say to heroku "Please add this new key" with:
heroku keys:add
and then the terminal responds:
Found the following SSH public keys:
1) github_rsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 2
Uploading SSH public key /Users/demarox/.ssh/id_rsa.pub... failed
! This key is already in use by another account. Each account must have a unique key.
I don´t understand what is happening, maybe computers are not my fort. And I am not using github_rsa.pub because it gave me more errors with heroku, and seems like id_rsa.pub is the ssh key that all people use, so I don´t want to mess with it. How do I Repair this?
EDIT: ok, maybe this will help. At this point I want to throw the computer out of the window.
Demarox:saga_plast_app demarox$ sudo git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Demarox:saga_plast_app demarox$ sudo ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/var/root/.ssh/id_rsa):
/var/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/root/.ssh/id_rsa.
Your public key has been saved in /var/root/.ssh/id_rsa.pub.
The key fingerprint is:
f9:d0:45:80:4d:53:63:e5:36:38:60:80:ce:c8:1d:c9 root@Demarox.local
The key's randomart image is:
+--[ RSA 2048]----+
| . o.=*o=.. |
| E ...= + |
| . = . + + |
| o + o . o . |
| S . |
| o |
| . |
| |
| |
+-----------------+
Demarox:saga_plast_app demarox$ heroku keys:add
Found the following SSH public keys:
1) github_rsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 2
Uploading SSH public key /Users/demarox/.ssh/id_rsa.pub... failed
! This key is already in use by another account. Each account must have a unique key.
Demarox:saga_plast_app demarox$ heroku keys:clear
Removing all SSH keys... done
Demarox:saga_plast_app demarox$ heroku keys
You have no keys.
Demarox:saga_plast_app demarox$ heroku keys:add
Found the following SSH public keys:
1) github_rsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 2
Uploading SSH public key /Users/demarox/.ssh/id_rsa.pub... failed
! This key is already in use by another account. Each account must have a unique key.