Comments (3)
Ok i got this working. The problem is the folder permission for your GIT folder, it needs to be www-data (or httpd/apache user, the PHP file is run by apache user, so the git folder should be your apache user.)
You need to have the public keys generated for www-data user (or apache/httpd user based on your server configuration).
Step 1: (ON YOUR SERVER)
#let's be root
sudo -i
##go the apache folder
cd /var/www
##create folder to store keys
mkdir .ssh
chown -R www-data:www-data .ssh
##create keys
sudo -u www-data ssh-keygen -t ed25519 -C "[email protected]"
#click yes, yes in case you dont need a passphrase
##Start the ssh-agent in the background.
eval "$(ssh-agent -s)"
##add Key
ssh-add ~/.ssh/id_ed25519
##Copy the generated Pub key to be pasted on github.com
tail /var/www/.ssh/id_ed25519.pub
#Attempts to ssh to GitHub
sudo -u www-data ssh -T [email protected]
Step 2:
Copy/Add the key displayed above in tail command to your github account or repo, Repo->Settings->Deploy Keys.
#type "yes"
Step 3: (OPTIONAL, in case you had used HTTPS like me, you need to change it to ssh git)
Cd to your git folder for e.g /var/www/my-project folder
nano .git/config
Change
url = https://github.com/username/reponame
to
url = [email protected]:username/reponame.git
from git-deploy.
Getting similar error for private repo
=== ERROR: Pull failed using GIT /usr/bin/git
and DIR /var/www/xxxx
===
fatal: could not read Username for 'https://github.com': No such device or address
from git-deploy.
Hi, I follow the steps above, but still get error as below:
can anyone help out~
=== ERROR: Pull failed using GIT /usr/bin/git
and DIR /opt/bitnami/apache2/htdocs/
===
Could not create directory '/usr/sbin/.ssh'.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
from git-deploy.
Related Issues (20)
- what is secret-token? HOT 1
- [feature request] response message body HOT 3
- Git pull not being executed over SSH HOT 1
- SSH not allowed on some hosts HOT 1
- `DIR` always needs to end in a forward slash, otherwise the script errors HOT 2
- always sh: 1: /usr/bin/git: not found HOT 2
- [feature request] support merge request events
- error on runtime T_PAAMAYIM_NEKUDOTAYIM
- [feature request] limit log file size
- Support for https for private OAUTH accounts using personal access tokens HOT 1
- Pull failed - permission denied HOT 2
- "No token detected" when token is provided HOT 2
- had problem
- had problem "Warning: shell_exec() has been disabled for security reasons" HOT 1
- "No output" error with github, works fine with gitlab HOT 1
- Permission Denied HOT 3
- Local commits / uncommitted changes are always reset when using gitlab webhooks
- Host key verification failed. HOT 2
- Paths HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-deploy.