Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6528679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:33:25+00:00 2026-05-25T09:33:25+00:00

How do I add SSH keys for ‘apache’ user in Linux? BACKGROUND I am

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:33:26+00:00Added an answer on May 25, 2026 at 9:33 am

    As you are root, you can try it sudo -u apache ssh-keygen -t rsa

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use ssh-agent with password-protected keys on Linux. Every time I log into a
Add service reference to Amazon service fails, saying Could not load file or assembly
I add a web reference to my wse 3.0 service in Visual Studio 2005
I removed my SSH Keys in an effort to backtrack a little bit. When
system(ssh test.host.com); its asking for permentaly add key or not ? I want automatically
(Using Vista)I'm trying to clone an app from my GitHub Repository and push it
ssh will look for its keys by default in the ~/.ssh folder. I want
My SSH keys are associated with my root directory and have none associated with
How do i run ssh-add key sudo hg clone hg@bitbucket.org/etc/etc but use my ssh
This works fine when I run it by hand: #!/bin/bash eval `ssh-agent` ssh-add /usr/bin/scp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.