Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (27.5k points)

I'm attempting to deploy my code to heroku with the following command line:

$ git push heroku master

but get the following error:

Permission denied (publickey).

fatal: The remote end hung up unexpectedly

I have already uploaded my public SSH key, but it still comes up with this error.

1 Answer

0 votes
by (19.4k points)

Step 1:  Take a look at the keys that you have in Heroku:

$ heroku keys

=== 1 key for [email protected]

ssh-dss AAAAB8NzaC...DVj3R4Ww== [email protected]

Step 2: Now build a ~/.ssh/config file:

$ sudo vim ~/.ssh/config

Edit with the following content. 

Host heroku.com

Hostname heroku.com 

Port 22 

IdentitiesOnly yes 

IdentityFile ~/.ssh/ssh-dss 

TCPKeepAlive yes 

User [email protected]

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...