views:

70

answers:

3

In git/gitosis a single ssh key is stored with the filename the same as user name.

i.e. myusername.pub

If I want to access a repository from many machines, must I make a new user from each location or is there a way to have multiple ssh keys for a single user.

A: 

Users in gitosis are not "normal" users, so yes, you create a user per ssh key. This article explains it very well.

(Alternatively you copy your key on all your machines, not as nice/secure but works fine too)

Peter Tillemans
+2  A: 

Actually, gitosis supports that. You just have to add the ssh key on a new line in the key file.

igorw
A: 

Gitosis talks through SSH, and uses SSH keys to uniquely identify users. If you want to act as the same user on multiple machines, you simply need to copy the private key (~/.ssh/id_rsa) to the ~/.ssh directory on the second machine. If the second machine already has a key, you can copy the key to a different filename (say ~/.ssh/mygitkey) and configure SSH to use it for the appropriate server. Edit/create the ~/.ssh/config file and add this content:

host mygitserver
    identityfile ~/.ssh/mygitkey
Ben Straub