mathlearner
mathlearner

Reputation: 7659

How to remove previous account in heroku

i have to switch heroku account from one to another .i tried using heroku login.but when i try to deploy my app using command

git push heroku master

but i am getting error

Agent admitted failure to sign using the key.

 !  Your account [email protected] does not have access to young-plains-9347.
 !  
 !  SSH Key Fingerprint: 3f:bf:62:23:04:b3:7a:ff:a8:15:59:43:37:c0:4d:6e

fatal: The remote end hung up unexpectedly

where [email protected] is my previous account .how to get rid of this error ??please guideline .

Upvotes: 7

Views: 4360

Answers (6)

Zeeshan Ahmad Khalil
Zeeshan Ahmad Khalil

Reputation: 863

In addition to @friism answer.

The new link for Heroku accounts. The previous one is deprecated. The command to remove the account is: heroku accounts:remove personal

Also, you can check out other commands in the above link to add multiple accounts and switch account.

Upvotes: 0

vasilakisfil
vasilakisfil

Reputation: 2329

This is unrelated to heroku toolbelt per-se. What happens in your case probably is that the git (through ssh-agent) is unaware of the ssh key of the account you are trying to use, assuming that you have one (if you don't have one, you need to generate one and add it through heroku keys:add).

All you need to do is to add the ssh key to the user agent by running ssh-add ~/.ssh/your-other-ssh-key. If ssh-agent is not running already, you can start it using eval "$(ssh-agent -s)".

Upvotes: 0

Eng_Farghly
Eng_Farghly

Reputation: 3017

To remove previous account you should logout from command line:

heroku logout

And login again to add new account:

heroku login

You can manage multi accounts for heroku by installing heroku accounts package

Upvotes: 1

WINGLEUNG CHOI
WINGLEUNG CHOI

Reputation: 134

I figure it out after 4 hours struggling.

To simply remove previous account,

  1. just uninstall Herouku toolbelt completely.

https://devcenter.heroku.com/articles/heroku-command#uninstalling-the-heroku-cli

  1. restart computer
  2. reinstall it
  3. login heroku in terminal
  4. create ssh following Heroku guide.

Done! That simply removes previous account.

Upvotes: 1

Moin Haidar
Moin Haidar

Reputation: 1694

#list of accounts
heroku accounts

#Remove a account
heroku accounts:remove personal

#Set a new account # in project root
heroku accounts:set personal

#Set machine wide default account
heroku accounts:default personal

Upvotes: 1

friism
friism

Reputation: 19279

You can use Heroku accounts to switch between multiple Heroku accounts. Also see the Dev Center article for details.

Upvotes: 1

Related Questions