You are not logged in.

#1 2012-07-18 03:23:00

forbajato
Member
Registered: 2012-07-18
Posts: 4

Mercurial-server or gitolite server

I am trying to set up a git or mercurial server on my Arch server machine. I am using Arch for ARM and have asked in those forums without help so decided to see if anyone here can help me out.  My problem is that when setting up mercurial-server or gitolite you create a user, but not a normal user.  For mercurial-server the AUR package install creates the user for you, for gitolite you create the user from the command line using:

# useradd -m -U -r -s /bin/bash -d /srv/git git

After installing the package and creating the user you put your ssh public key into a place that user can use (for gitolite it is the .ssh/authorized_keys file for the git user, for mercurial-server it is in the /etc/mercurial-server tree).

In both cases the user doesn't have normal shell access, however I find when I try to connect with the server from my workstation I get a request for the newly created user's (either hg or git) password.

For the gitolite setup I followed this wiki page: https://wiki.archlinux.org/index.php/Gitolite with some needed modifications (i.e. the new version of gitolite doesn't have a gl-setup command) from here: http://sitaramc.github.com/gitolite/setup.html

For the mercurial-server setup I followed this tutorial: http://dev.lshift.net/paul/mercurial-se … cbook.html

Both result in the same type of error - a request by the server for the password for the hg or git user.  I suspect this has to do with a problem in how the ssh keys are set up but I can't find a cure.  Can anyone help me understand what is going wrong here?

thomas

Offline

#2 2012-07-18 13:15:56

nobody44
Member
Registered: 2011-08-25
Posts: 29

Re: Mercurial-server or gitolite server

Hi,
What exactly are your "needed modifications", except the new gitolite-command?
Assuming you have a user "git" with a clean home directory and a public key named "forbajato.pub":
Execute

[git@raspgit ~]$ gitolite setup -pk forbajato.pub

Add to your .ssh/config:

Host raspgit
HotName 123.456.789.012
User git
IdentityFile ~/.ssh/forbajato

Done. Now you should be able to clone the gitolite-admin repository with the command "git clone raspgit:gitolite-admin gitolite-admin".
You should ALWAYS use the gitolite-admin-repository to add/delete new repositories, users or public-keys. Never change the authorized_keys manually (except you want direct shell access).

After reading your post again, I am not sure what exactly you want...
So... I ask: "What do you want?".

BTW: I would disable password-authentication.

nobody44

Offline

#3 2012-07-19 03:01:54

forbajato
Member
Registered: 2012-07-18
Posts: 4

Re: Mercurial-server or gitolite server

nobody44,

Sorry my original post was confusing. 

Bottom line - I want to be able to run a revision control system on my local network, hosted on an Arch box.  What I really needed was your assistance with the .ssh/config file - thanks!  Just to clarify for others reading this thread in the future - the .ssh/config file you list should be in the workstation's ~/.ssh directory (which will also house the key pair the user is using to access the gitolite server). 

Also there is a minor typo in the .ssh/config code, it should read "HostName" not "HotName" with the IP address of the machine running gitolite.

The modification I had to make to the gitolite tutorial on the ArchWiki was to replace "gl-setup..." with "gitolite setup ...".  It is helpful for me (a newbie) to know that the command you suggest ("git clone raspgit:gitolite-admin gitolite-admin") has the same results as the ArchWiki tutorial command ("git clone git@raspgit:gitolite-admin").  Finally - perhaps that tutorial needs the tip about editing the .ssh/config file added as well?

Thanks for the input!

thomas

Last edited by forbajato (2012-07-19 03:03:52)

Offline

#4 2012-07-19 08:02:24

nobody44
Member
Registered: 2011-08-25
Posts: 29

Re: Mercurial-server or gitolite server

I have updated the gitolite-wikipage. Would anyone review it please?

I have set up a gitolite server on my Raspberry Pi and I am heavily surprised :-). It handles "big" repositories (~700MB) without any problems (it doesn't abort with an error, it's not really fast though)... I didn't expect that.

BTW: The .ssh/config file is very helpfull, if you use private keys (that's why the password-authentication was used in your case. You didn't specify the private key). I still don't know how to mount a sshfs using a private key and without using the .ssh/config-file. The sshfs-command doesn't handle private keys afaik... I might be wrong though...

Offline

#5 2012-07-19 11:08:50

forbajato
Member
Registered: 2012-07-18
Posts: 4

Re: Mercurial-server or gitolite server

Excellent update to the wiki page - even a newbie like me can follow that, very clear!

I have been using sshfs to do password free mounting of network shares without having a .ssh/config file forever.  I assumed it was just using the keys available in my .ssh directory. I do have a shell access account on the server box and sent my normal public key to the server with ssh-copy-id.

thomas

Offline

#6 2012-07-19 11:40:39

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: Mercurial-server or gitolite server

nobody44 wrote:

BTW: The .ssh/config file is very helpfull, if you use private keys (that's why the password-authentication was used in your case. You didn't specify the private key). I still don't know how to mount a sshfs using a private key and without using the .ssh/config-file. The sshfs-command doesn't handle private keys afaik... I might be wrong though...

You should be able to set all options on the commandline. the manpage contains the parameter "-o SSHOPT=VAL          ssh options (see man ssh_config)", so use "-o IdentityFile=~/my_file"


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2012-07-19 12:04:31

nobody44
Member
Registered: 2011-08-25
Posts: 29

Re: Mercurial-server or gitolite server

You are both right :-).
sshfs searches for ~/.ssh/id_rsa only without the "-o IdentityFile=..."-option.
The ~/.ssh/config-way is still easier IMHO... and shorter!

Offline

Board footer

Powered by FluxBB