0

Is there a way to save credentials for the www-data user on ubuntu? I need it to push to a private Github repo in a php script, but at the moment it's not working due to needing credentials each run.

Thanks in advance :)

JacobCXDev
  • 417
  • 6
  • 16
  • Possible duplicate of [Is there a way to skip password typing when using https:// on GitHub?](https://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github) – phd Oct 20 '18 at 19:33
  • https://stackoverflow.com/questions/17864306/how-to-make-git-not-ask-me-for-password-when-accessing-remote-repositories – phd Oct 20 '18 at 19:34
  • https://stackoverflow.com/search?q=%5Bgit%5D+prevent+asking+password – phd Oct 20 '18 at 19:34

1 Answers1

0

If you use SSH to access the GitHub remote instead of HTTPS you can authenticate with SSH keys. Generate a password-less SSH key as www-data, then add the generated public key in GitHub settings.

See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-linux and https://help.github.com/articles/reviewing-your-ssh-keys/

ianml
  • 772
  • 5
  • 9