This guide describes how to give someone access to the LegUp git repository.
First make sure you have the latest version of the gitosis-admin repo (you need commit access on your machine to checkout this repository):
git clone git@legup.org:gitosis-admin gitosis-admin cd gitosis-admin/ git pull
Get the user to send you their ~/.ssh/id_rsa.pub file as described in Computer Setup.
Take a look at their id_rsa.pub file:
cat /path/to/id_rsa.pub
The file contents will look like:
ssh-rsa AAA...GiB acanis@acanis-desktop
In this case the hostname is “acanis@acanis-desktop”. Now look in the keydir folder to see if they already have a key file there with the file extension .pub:
ls keydir/acanis@acanis-desktop.pub
If there is no existing file (the usual case) copy their key file into the keydir directory:
cp /path/to/id_rsa.pub keydir/acanis@acanis-desktop.pub
In some cases the same hostname can have multiple entries (for example legup@legup.pub). In that case append the new key value to the existing file:
cat /path/to/id_rsa.pub >> keydir/acanis@acanis-desktop.pub
Note: the above file naming scheme is just to keep the directory organized. There is no actual requirement for the filename to match the hostname.
Now modify the gitosis.conf file and add their hostname to the legup-team group. Notice there is no .pub extension here:
[group legup-team] writeable = .... members = ..... acanis@acanis-desktop
If you wish for the new user to only have read-only access to the legup repository, you should add them to the readonly group instead:
[group readonly] readonly = legup members = ... new_user@new_host
Add everything to git:
git add gitosis.conf keydir/acanis@acanis-desktop.pub
Verify the changes as you commit:
git commit -v
Finally push:
git push