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

  • Home
  • SEARCH
  • 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 3623420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:22:53+00:00 2026-05-18T23:22:53+00:00

The dilemma: a Linux program that I’m working on should: Fetch a package over

  • 0

The dilemma: a Linux program that I’m working on should:

  1. Fetch a “package” over git+ssh:// protocol (using Git).
  2. Install that “package” in the system.

For git+ssh to work, Git needs to see my keys.

For the “package” installation, the program must have superuser privileges.

A limitation: the program should not elevate privileges (call sudo) by itself. User must explicitly invoke it with sudo. (Lets ignore the case when user runs the program while begin logged in as root — assuming he will setup keys correctly then.)

So, the question is: how to do ssh access with user keys from the program that is invoked with sudo?

  • 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-18T23:22:53+00:00Added an answer on May 18, 2026 at 11:22 pm

    use the -i identity_file ssh parameters. To tell git to use the proper command you should set the GIT_SSH variable to a file that will call ssh -i “$@”.

    If you can’t do that then you should drop privileges while you do the git pull command.

    sudo -u <original_user> git fetch git+ssh:// 
    

    You can use the ${SUDO_USER} enviroment variable to find out who the original user was.

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

Sidebar

Related Questions

I have a little dilemma that maybe you can help me sort out. I've
Okay, my dilemma is this. I have an admin page that I use to
So this is my dilemma - I am using the excellent codeigniter-simpletest library by
I'm not sure if I phrased that correctly but here's my dilemma. I inherited
My dilemma is this: I have a PHP page with a form that includes
So here is my dilemma, I have a navigation controller that controls three views.
So here's the dilemma: I'm writing a progam using two different class using two
I got into a dilemma about using has_many, :through. Suppose I am trying to
I have run into a common dilemma. Many times, our company relies on using
I'm facing the normalization dilemma. Now that OpenID has been declared a failure ,

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.