Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ruigoncalves opened this issue Aug 28, 2012 · 2 comments

Comments

@ruigoncalves
Copy link

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/known_hosts).
Could not create directory '/var/www/.ssh'.

Some information about my system configuration:

  • Redmine 1.3.2 stable (mysql)
  • Redmine git hosting plugin 0.4.2

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

@borgified
Copy link

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
Copy link

This worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants