ericpaulbishop / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
186 stars 37 forks source link

Could not create directory '/var/www/.ssh' - error message after pushing an existing repo #170

Open ruigoncalves opened 12 years ago

ruigoncalves commented 12 years ago

Hi there!

After pushing an existing git repo into Redmine, the following error message is constantly logged in the apache error log file: _Failed to add the host to the list of known hosts (/var/www/.ssh/knownhosts). Could not create directory '/var/www/.ssh'.

Some information about my system configuration:

Does anyone know why this is happening? Thanks for the help, Regards!

borgified commented 11 years ago

note: i got here searching on a diff issue with perl's Net::OpenSSH package but it has similar error to yours.

probably the apache2 user (www-data for ubuntu users) trying to use ssh to connect to another machine default location to store known_hosts for ssh is ~/.ssh/known_hosts so the home (~) directory of www-data is /var/www, that translates to /var/www/.ssh/known_hosts since www-data cannot write to /var/www, you get error.

i found that i can ignore the "Could not create directory '/var/www/.ssh'." if i just created a empty /var/www/.ssh file there just to hold that spot. -rw-r--r-- 1 root root 0 2013-02-07 16:11 .ssh

i tried creating the .ssh directory as the error suggested and gave it permissions for www-data to write in it and it didnt seem to try to write anything in there anyway so it's probably ok to ignore.

wonjun27 commented 9 years ago

This worked for me as well.