Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitosis: same user multiple machines

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.

like image 211
zenna Avatar asked Jun 23 '10 19:06

zenna


2 Answers

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

like image 109
igorw Avatar answered Oct 23 '22 12:10

igorw


You can no longer add a key per line in the .pub files as suggested by igorw. I tried it and got the following message back.

WARNING: a pubkey file can only have one line (key); ignoring kent.pub
         Perhaps you're using a key in a different format (like putty/plink)?
         If so, please convert it to openssh format using 'ssh-keygen -i'.
         If you want to add multiple public keys for a single user, use
         "[email protected]" file names.  See the "one user, many keys"
         section in doc/3-faq-tips-etc.mkd for details.

I tried the suggested solution which was to create a new pub file with the name <user>@<host>.pub and it worked fine.

like image 20
Mattias B Avatar answered Oct 23 '22 12:10

Mattias B