How do I add SSH keys for ‘apache’ user in Linux?
BACKGROUND
I am trying to add a service hook to github to notify a URL once I push to my repo. I have the following php page set up:
<?php `git pull origin master`;
However I get the following output:
sh: git: Permission denied
This is because the keys I generated for github access were generated by my ‘root’ user. However when I exectue a command from php it is the ‘apache’ user that runs it.
The keys therefore do not correspond and permission is denied to pull.
As I cannot switch user from the terminal to generate keys as ‘apache’, I am not too sure what to do. Can anyone suggest a solution?
As you are root, you can try it
sudo -u apache ssh-keygen -t rsa