5

Some time ago I stumbled upon an explanation on how to set up git authentication via the web server somehow. That way no ssh key swapping would be needed on client side.
Shame on me, I did neither bookmark its link nor can remember the technique.

I just miss throwing out a username:password combo to give access to some throwaway repositories. When prototyping some VM setups it was the last time I felt this need, snapshots were not an ideal solution.

Is it possible to use git just with password-based authorization?

Another example use case I heard of would be in university, where this approach is way less organisational overhead to set up new accounts for 30 people every semester. Imagine collecting ssh keys from a bunch of people that have trouble to just generate an own key pair, not even speaking of the people's lack of knowledge what a VCS even is or what it is used for.

Of course, a solution to this would be to just use SVN for version control. But is it neccessary to put SVN to use when you can have git?

To prevent misunderstandings, I have my own server running a working gitolite setup and am perfectly fine with using ssh keys client- and server-wise.

sjas
  • 18,644
  • 14
  • 87
  • 92
  • http://sitaramc.github.com/gitolite/http.html might be what you are looking for – ThiefMaster Dec 31 '12 at 18:12
  • @ThiefMaster: In the last sentense he write that he use gitolite. I think he need only a https / SSL auth. – René Höhle Dec 31 '12 at 18:22
  • See this question for answers to some of your questions. Basically, yes, you can use the 'git' protocol. – Lee-Man Dec 31 '12 at 18:29
  • git uses the .ssh/config file, so if you specify the git host entry as having the property 'PreferredAuthentications password' then it will prompt for a password, and not try to use the public key method – Anya Shenanigans Dec 31 '12 at 18:30
  • I think you're looking for this answer on SU: http://superuser.com/questions/315848/gitosis-with-password-authentication-dont-want-to-use-ssh-key – iwein Dec 31 '12 at 18:52
  • @iwein, you double-posted, heh :) – Nevik Rehnel Dec 31 '12 at 19:12

1 Answers1

2

You can use gitolite with any service able to provide an authentication (so rules out the git protocol which has no authentication).

My https configuration will call gitolite with the id that the apache server will give to the gitolite script.

ScriptAlias /hgit/ @H@/sbin/gitolite-shell/
SetEnv GIT_HTTP_BACKEND "@H@/usr/local/apps/git/libexec/git-core/git-http-backend"
<Location /hgit>
   ...
</Location>
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you! Is there something about git, that you do not know? :-) – sjas Jan 01 '13 at 13:22
  • @sjas plenty! That is why I have been answering git questions for the past 4 years. It not only helps me on Git itself, on version control in general, and on tons of related topics (like Wan access to git repos: stackoverflow.com/a/14110800/6309) – VonC Jan 01 '13 at 13:31