- I have a 'git --bare' repo on a linux machine.
- I wish to allow another user from a different machine to push/pull to it.
- I have their ssh key.
Is there some way I can allow them to execute the command,
git clone ssh://user@server:/home/user/name.git
At the moment, I simply added their ssh key to my authorised keys... but that's not ideal. Searching around I only find suggestions for either moving to github or having a dedicated server with all the ssh keys for access (neither desirable).
Ideal would be if in the name.git directory I could execute something to add an ssh-key as an authorised pusher/puller,
git add --ssh <key> #not a real command
I'm on GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) with git 1.7.1.
Update: comments about gitolite led me to find this post which part solves my problem by using ssh 'authorized_key file formats' (manual) to allow only git-shell access. ssh-key-user now has access to only git folders, but I have not restricted their access to specific repo(s).