Managing SSH keys on Heroku

Heroku uses Git for your code repo, and therefore uses SSH to talk to the remote server. If you’re already using an SSH keypair for another repo or elsewhere, you may have to explicitly manage which of your key’s you want to use to access Heroku.

To list your current keys you’ve shared with Heroku:

heroku keys

To add a new key – run this from your ~/.ssh/ dir:

heroku keys:add keyfilename (e.g. rsa_id.pub)

If you get this error:

Fingerprint already exists. Please use one SSH key per Heroku account

… it’s because you’ve already used this SSH key with another account.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.