Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up git server WITHOUT ssh auth

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.

like image 845
sjas Avatar asked Nov 03 '22 07:11

sjas


1 Answers

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>
like image 81
VonC Avatar answered Nov 07 '22 20:11

VonC