我不知道我做了什麼,但對我來說它現在是一個真正的混亂。 我試着去推我的Rails應用程序的代碼的Heroku與厭倦了Heroku爲我的導軌應用程序SSH混亂
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.
好了,現在我西港島線嘗試修復它做一個新的SSH密鑰
sudo ssh-keygen -t rsa
我按下輸入三次,然後我的SSH密鑰創建好了。
但現在,當我到Heroku的說「請添加新鍵」與:
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.
我不明白髮生了什麼,也許電腦不是我的堡壘。而且我沒有使用github_rsa.pub,因爲它給了我更多的heroku錯誤,並且好像id_rsa.pub是所有人使用的ssh密鑰,所以我不想惹它。我該如何修復?
編輯:好的,也許這會有所幫助。在這一點上,我想把電腦扔出窗外。
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 [email protected]
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.
我認爲你需要一個關於SSH的入門書。首先,閱讀本教程:http://support.suso.com/supki/SSH_Tutorial_for_Linux然後,檢查此stackoverflow問題(我知道你沒有使用多個Heroku帳戶,但如果你使用多個**任何**帳戶與SSH,這個問題是有幫助的):http://stackoverflow.com/questions/4663103/multiple-heroku-accounts – richsinn