-
Notifications
You must be signed in to change notification settings - Fork 271
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
Host key verification failed for private repository #65
Comments
Is there any solution? |
No luck. Please do post here if you find any solution. |
I'm having the same issue...have setup the SSH key and everything but no luck. Works a charm on public projects but that's no good to me.. |
I found out why it doesn't work - basically is is because git sends message to deploy.php and then apache is trying to run "git clone..." on your server, well, apache is not root so it runs (in my server it's daemon on others it's www-data) the command and it won't let it to add git to known_hosts. Try to run this on your server: for me it's asking me to save git to known host: I write "yes" and this is what I got And this is weird because I opened the permissions to the known_hosts file... |
You need to generate a key for www-data user and added to github repo. how to generate a ssh key as web server user: Good luck! |
Thanks! this tip took me one step forward, the problem now is that I cannot add the new id_rsa to ssh-agent for some reason.. When I try to write this: It says: |
I got it working on private repository too. I have followed below steps : Note : For debian system(which i am running), www-data is the Apache user. If you are on non-debian system you can check apache user by this command : ps aux | egrep '(apache|httpd)' and replace that user name with www-data here.
That's it !! Happy Coding 👍 |
Thanks for you replies! I had generated the SSH key and hooked it up in
|
tl;dr - working if you remove passphrases from id_rsa file. Long story: This because id_rsa has 600 rights (reading only for its owner - which is the apache user), and if you change this permissions then git won't accept this key because its permissions are too open. I ended up removing the encryption for this key by running this line: Since then everything is working fine :) (I'm not sure what are the implications of this passphrases removal) |
I see - thank you for confirming, much appreciated! On Wed, Jan 6, 2016 at 10:26 AM, orendecor [email protected] wrote:
|
I'm having the same trouble. This was working perfectly when my repository was public, but it broke when I went private. I initially encountered the error: I contacted GitHub and was instructed to add GitHub's public key to the known hosts file, which I did with ssh -T [email protected]. However, I still got the error. Next, per GitHub support, I added GitHub's key to the global known hosts file with ssh-keyscan -t rsa github.com >> /etc/ssh/ssh_known_hosts Then I got this: I have checked and verified that there is a GitHub key in that global known_hosts file. But the error persists. I have tried kalpitpandit's solution, and copied the keys into the var/www directory and chown the .ssh and project directories to www-data:www-data (I'm on Ubuntu). Currently I am getting this error: _ Please make sure you have the correct access rights_ I currently have the same ssh keys in root and in var/www. private keys have permission 600 and public keys have 644. I'm at a loss at this point |
I just got this to work. It ended up being a combination of incorrect ownership (username:psacln) and placing the .ssh folder in the wrong directory. It had to be in the project directory itself instead of in /var/www/. Now on to more important things ... |
I opened #68 which is a related issue/request |
I could't make work the private repo from BitBucket, so at this point my solution was quite dirty but straight forward, adding the password in the url: I know this is not the best solution, but at least it's a provisory solution. |
I am getting below error when i am running /deploy.php from browser or if i push anything in repository.
$ git clone --depth=1 --branch master [email protected]:myrepository.git /tmp/spgd-8fbc87725193f8667aff13a1372edd28/
Cloning into '/tmp/spgd-8fbc87725193f8667aff13a1372edd28'...
Host key verification failed.
fatal: Could not read from remote repository.
When i run $ git clone --depth=1 --branch master [email protected]:myrepository.git /tmp/spgd-8fbc87725193f8667aff13a1372edd28/ directly in terminal its cloning repository without any error.
I have also referred #9 but didn't help.
The text was updated successfully, but these errors were encountered: