Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Git not pushing to Heroku (Permission Denied (publickey))

I'm trying to push my treebook app into heroku but I get the permission denied error even though I have typed "heroku keys:add"

The response is this:

Found existing public key: /Users/ureyes/.ssh/github_rsa.pub
Uploading SSH public key /Users/ureyes/.ssh/github_rsa.pub... done

However, after doing that typing 'git push heroku master' gives me this error:

ssh: Could not resolve hostname heroku.com: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

1 Answer

Naomi Freeman
Naomi Freeman
Treehouse Guest Teacher

You can run

heroku keys

to see a list of all your heroku keys.

Then you can do

heroku keys:remove adam@workstation.local (replace adam@workstation.local with whatever one of your keys is named)

You can remove all your keys.

Then make sure to

heroku login

before you start.

Once logged in, try

ssh-keygen -t rsa

to generate a new key.