-
-
Save guillaumepotier/540209652d0f60c92aa008d99f725713 to your computer and use it in GitHub Desktop.
Creation of Git deployment key for user www-data on Debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let's be root | |
su | |
# 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 rsa | |
# add it to gh | |
# add known hosts | |
# https://stackoverflow.com/questions/40442476/github-authentication-failed-with-user-www-data | |
ssh-keyscan -t rsa github.com >> /var/www/.ssh/known_hosts | |
# update a repository | |
cd /data/git/some-repository | |
sudo -u www-data git pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment