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 8379841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:17:55+00:00 2026-06-09T16:17:55+00:00

I have the following setup: A server (centOS) with git and a repository for

  • 0

I have the following setup:

A server (centOS) with git and a repository for a project on the same server.

What I need to do is to be able to pull from the repository without being asked for password (because is annoying).

Note: I am logged as root when I pull.

Can anyone help me with that?

  • 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-06-09T16:17:57+00:00Added an answer on June 9, 2026 at 4:17 pm

    There are a few options, depending on what your requirements are, in particular your security needs. For both HTTP and SSH, there is password-less, or password required access.

    HTTP

    ==============

    Password-Less

    Useful for fetch only requirements, by default push is disabled. Perfect if anonymous cloning is the intention. You definitely shouldn’t enable push for this type of configuration. The man page for git-http-backend contains good information, online copy at http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html. It provides an example of how to configure apache to provide this.

    User/password in .netrc or url embedded

    Where .netrc files are using in the form:

    machine <hostname> login <username> password <password>
    

    And embedded urls would be in the form:

    http://user:pass@hostname/repo
    

    Since git won’t do auth for you, you will need to configure a webserver such as apache to perform the auth, before passing the request onto the git tools. Also keep in mind that using the embedded method is a security risk, even if you use https since it is part of the url being requested.

    If you want to be able to pull non-interactive, but prevent anonymous users from accessing the git repo, this should be a reasonably lightweight solution using apache for basic auth and preferably the .netrc file to store credentials. As a small gotcha, git will enable write access once authentication is being used, so either use anonymous http for read-only, or you’ll need to perform some additional configuration if you want to prevent the non-interactive user from having write access.

    See:

    • httpd.apache.org/docs/2.4/mod/mod_auth_basic.html for more on configuring basic auth
    • http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html for some examples on the apache config needed.

    SSH

    ==============

    Passphrase-Less

    Opens up for security issues, since anyone who can get a hold of the ssh private key can now update the remote git repo as this user. If you want to use this non-interactively, I’d recommend installing something like gitolite to make it a little easier to ensure that those with the ssh private key can only pull from the repo, and it requires a different ssh key pair to update the repo.

    See github.com/sitaramc/gitolite/ for more on gitolite.

    stromberg.dnsalias.org/~strombrg/ssh-keys.html – for creating password less ssh keys:
    May also want to cover managing multiple ssh keys: http://www.kelvinwong.ca/2011/03/30/multiple-ssh-private-keys-identityfile/

    Passphase protected

    Can use ssh-agent to unlock on a per-session basis, only really useful for interactive fetching from git. Since you mention root and only talk about performing ‘git pull’, it sounds like your use case is non-interactive. This is something that might be better combined with gitolite (github.com/sitaramc/gitolite/).

    Summary

    ==============

    Using something like gitolite will abstract a lot of the configuration away for SSH type set ups, and is definitely recommended if you think you might have additional repositories or need to specify different levels of access. It’s logging and auditing are also very useful.

    If you just want to be able to pull via http, the git-http-backend man page should contain enough information to configure apache to do the needful.

    You can always combine anonymous http(s) for clone/pull, with passphrase protected ssh access required for full access, in which case there is no need to set up gitolite, you’ll just add the ssh public key to the ~/.ssh/authorized_keys file.

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

Sidebar

Related Questions

Let's say you have the following setup. You have a server with the basepath
I have the following setup, and I need to know how to persist state.
I have the following setup: eclipse a standard Java project (A) an eclipse plugin
I have the following setup: Sharepoint 2010 with SQL Server and Office 2010. This
Related to: How to setup the ideal collaboration repository setup? I have the following
I have currently the following setup: An object graph of all requests read from
I have the following setup: The server will connect via Bluetooth to several devices
I'm doing some testing with WCF and we currently have the following Server setup
I have a CentOS 6 server set up with git, gitosis, nginx, and php-fpm.
I have the following setup: Dedicated server --> Internet --> Modem (telenet) --> Router

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.