Gitosis on Cygwin : Tips and Tweaks

In my last two posts, I blog about Git installation and Git Troubleshooting.

This time, I will cover some tweaks that you could do on Windows.

  • Hide unwanted users from Windows’s login screen
  • Change Gitosis path

Hide unwanted users from Windows’s login screen

I’m pretty sure that you don’t want the users created for Gitosis in your Windows’s login screen.

To Hide them, we will have to run a little script that will give them a special status in Windows’s Registry.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList]
"git"=dword:00000000
"cyg_server"=dword:00000000



Create a file with the extension .reg and double click on it. If you didn’t use the default username in Gitosis’s installation, you will have to adapt the script.

The result will be this :

Changed Gitosis path

One thing that I had to do, was to move Gitosis repository path. I installed Gitosis in the default home of the user git. (/home/git/…) The problem was that I didn’t have enough free space on that hard drive.

To solve that problem, I moved the home folder of git to my “D” drive.

All the magic start by editing : /etc/passwd logged with you Administrator user. You will have to change the path (/home/git) to a new path. In my case, I changed it to : /cygdrive/d/gitosis-repo


$ cat /etc/passwd
SYSTEM:*:18:544:,S-1-5-18::
LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
Administrators:*:544:544:,S-1-5-32-544::
Administrator:unused:500:513:U-bob-PC\Administrator,S-1-5-21-2630779338-38
2115681-2868927028-500:/home/Administrator:/bin/bash
Guest:unused:501:513:U-bob-PC\Guest,S-1-5-21-2630779338-382115681-28689270
28-501:/home/Guest:/bin/bash
HomeGroupUser$:unused:1005:513:HomeGroupUser$,U-bob-PC\HomeGroupUser$,S-1-
5-21-2630779338-382115681-2868927028-1005:/home/HomeGroupUser$:/bin/bash
bob:unused:1003:513:U-bob-PC\bob,S-1-5-21-2630779338-382115681-28689
27028-1003:/home/bob:/bin/bash
sshd:unused:1006:513:sshd privsep,U-bob-PC\sshd,S-1-5-21-2630779338-382115
681-2868927028-1006:/var/empty:/bin/false
cyg_server:unused:1007:513:Privileged server,U-bob-PC\cyg_server,S-1-5-21-
2630779338-382115681-2868927028-1007:/var/empty:/bin/false
git:unused:1008:513:U-bob-PC\git,S-1-5-21-2630779338-382115681-2868927028-
1008:/cygdrive/d/gitosis-repo/:/bin/bash

After that, you have to log using git user : ssh git@localhost . It will create new profile in your new home folder.

Now, you have to moved the folder from your last home folder (/home/git) to this folder.

The important part now, it’s to recreate the symbolic link to gitosis.conf.

Use the command : ln -s TARGET LINK . In my case it was : ln -s /cygdrive/d/gitosis-repo/repositories/gitosis-admin.git/gitosis.conf .gitosis.conf


$ ls -la
total 30
drwxr-xr-x+ 1 git    None 4096 2010-09-11 15:34 .
drwxrwxrwx+ 1 jerabi None 4096 2010-09-11 15:32 ..
-rw-------  1 git    None  673 2010-09-11 15:38 .bash_history
-rwxr-xr-x  1 git    None 1150 2010-09-06 20:24 .bash_profile
-rwxr-xr-x  1 git    None 3754 2010-09-06 20:24 .bashrc
-rw-r--r--  1 git    None   55 2010-09-06 21:36 .gitconfig
lrwxrwxrwx  1 git    None   68 2010-09-11 15:32 .gitosis.conf -> /cygdrive/d/gitosis-repo/repositories/gitosis-admin.git/gitosis.conf
-rwxr-xr-x  1 git    None 1461 2010-09-06 20:24 .inputrc
drwx------+ 1 git    None 4096 2010-09-15 21:12 .ssh
drwxr-xr-x+ 1 git    None    0 2010-09-15 21:13 gitosis
drwxr-xr-x+ 1 git    None    0 2010-09-15 21:13 repositories

It was really useful for me, and I hope that it can help you too.

You can follow me on Twitter

This entry was posted in Uncategorized by . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>