please help me understand gitolite users [closed]

只谈情不闲聊 提交于 2019-12-04 17:38:09

I'll just point your 2 main errors:

1st error: Gitolite uses only the user part (the one previous to '@') of the keys found in the keydir.
For example: gitolite recognize only one user, william_slepecki, for the keys william_slepecki@compaid.com.pub and william_slepecki@anothercompaid.org.pub, the only point here is that this user can authenticate with 2 different keys, you can't give permissions to keys, only to users.

2nd error: Your gitolite service is provided only by one normal system user, probably git, so the connections should be made to git@server.com:repo.git, gitolite users don't need or have a system account, just a ssh key, so connecting to william_slepecki@server.com:repo.git would never work

Well, my problem was several fold.

First, i misunderstood the role of the gitadmin key. i thought that since that is the only user that has an actual account on the server that it needed to be on all the developers workstations. Turns out that was wrong. gitolite takes the keys in the keydir directory and adds them to the git/.ssh/authenticated_keys file on a push. This allows all the keys in the keydir to login as the user git on the machine. Since the git user does not have a console associated with it, there is no security hole.

Second, my ~/.ssh/conf file. Since i didn't understand how #1 worked, I thought git was passing the email address somehow as the username as part of the git commands. Once I figured out #1, i was able to clean the config file to map the git@server user and use my normal for everything else.

Once those two issues were understood and worked out, all permissions started working correctly. I have now replaced the gitadmin user key on the server to invalidate the ones on developers stations and updated all my developers configs. Management is happy again.

thanks everyone.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!