2

What I would like to do

How can I clone a git repository on my production server, without providing the account's password, and passphrase for the SSH key?

Perhaps what I'm asking is not possible. For the passphrase problem, I could generate the key without any passphrase, but not sure how secure that is.

What I currently do

I SSH to my server, with the account's username and password. I generate an SSH key on the server (which I then add to my Github account as an authenticated key). Each time I pull from the remote repo, I have to enter the passphrase.

The problem with this approach is that if I want someone else to pull the latest version of the repo on the production server, they will need the user and its password, along with the passphrase for the SSH key.

1
  • Not sure if it will work in your use case, but check into using SSH-Agent to cache the passphrase for the ssh key. Commented Dec 19, 2011 at 18:46

1 Answer 1

2

If your only concern is related to people being able to clone or pull from the repository, you can expose a bare repository over a webserver / HTTP. Git Book - Setting Up a Public Repository

There's also the corollary next page: Git Book - Setting Up a Private Repository if you want to grant others push access.

If you don't want to setup seperate accounts for every user, you can use a tool called Gitosis. In gitosis, there is an authorized_keys file that contains the public keys of everyone authorized to access the repository, and then everyone uses the 'git' user to do pushes and pulls.

3
  • 1
    Its important to note that gitosis has since been deprecated in favor of gitolite, which has shown continued development. Commented Dec 19, 2011 at 22:53
  • @Jeff From my understanding, exposing a bare repo over HTTP would make it open. This is a proprietary project. Commented Dec 20, 2011 at 7:56
  • @eoinoc Controls can be placed around the HTTP access... .htaccess files, internal subnets, etc. Commented Dec 29, 2011 at 4:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.