How to add a new ssh key to Gitolite

619 Views Asked by At

I simply want to add a new key. So I added it in the keydir, set the permissions in the gitolite conf, committed and pushed, but nothing.

At what point does the new key get added to the .ssh authorized-keys file? Because it seems the new key never makes it in there and that's why the person using the key cannot get access...

1

There are 1 best solutions below

5
On BEST ANSWER

At what point does the new key get added to the .ssh authorized-keys file?

Immediately after the push, provided your key:

  • is a public key (one line similar to ssh-rsa AAAAB3NzaC1yc2EAA...hFvETUVDvF2iZ)
  • is name after the name of the resource who will access gitolite: tom.pub

As the OP Dee confirms in the comments, the issue was in the public key filename representing the user:

the only error is bad username and i think this is because I used a '/' in the name of a group of user

Indeed, the username pattern is:

^\@?[0-9a-zA-Z][-0-9a-zA-Z._\@+]*$

No '/' allowed.