.ssh/id_rsa failed: permission denied .ssh/id_rsa failed: permission denied heroku heroku

.ssh/id_rsa failed: permission denied


You should own the permissions to the .ssh dir in your own directory, but in your case, it's owned by root. Try

cd ~sudo chown drewverlee .ssh

and then retry creating keys and connecting.


For some reasons, the id_rsa file in the ~/.ssh folder was in read-only mode for my user (0400). I changed that to read-write (0600) with

chmod 0600 id_rsa

and after I was obviously able to overwrite the file. I guess these are the highest permissions you can give to this file, as others wouldn't make too much sense.


I had the same problem on CentOS 6. Solved it by removing selinux:

sudo yum remove selinux*

found the answer here

note: probably not a good idea to blindly remove selinux if you don't know what you're doing though