Skip to contentSkip to conversation

User authentication in GIT

DISCUSSION supadhyay 6 participants 13 messages Jun 15, 2016

lore
Share & tools
lore

supadhyay

author
#0 lore raw

Hi All,

I want to migrate my existing version control system (CVS) into GIT. The first question which comes to me is in CVS we have user authentication like username and their password while in GIT there is SSH authentication.

Can any one suggest me what is the optimal way to manage the users in GIT? Does all users having username,passowrd and SSH key? or thre is no users credential but only SSH authentication? if I have 1000 users in old system CVS then do I need to create a key for all 1000 users in GIT? or etc.

Thanks in advance...

--
View this message in context: http://git.661346.n2.nabble.com/User-authentication-in-GIT-tp7261349p7261349.html
Sent from the git mailing list archive at Nabble.com.

author
#1 lore raw

Hi Robin and Jakub,

Thanks for your reply. But I am still not getting what exactly I need to perform on GIT server. Please find my reply on your suggestion below:

Robin:
All users must have their own SSH key. You do not create keys for them. My rely: can you please give some more idea about how it works.. I am not getting this or if you can provide any link for this to understand.

Jakub:
My reply: existing version control system used pserver protocol.

You would still need for each user to generate their own SSH key. My reply: Do I need to store all end users sSH key in .ssh/authorized_keys file on GIT server?

--
View this message in context: http://git.661346.n2.nabble.com/User-authentication-in-GIT-tp7261349p7262113.html
Sent from the git mailing list archive at Nabble.com.

#2 lore raw
Quoted 10 lines · supadhyay

Hi Robin and Jakub,

Thanks for your reply. But I am still not getting what exactly I need to perform on GIT server. Please find my reply on your suggestion below:

Robin:
All users must have their own SSH key. You do not create keys for them. My rely: can you please give some more idea about how it works.. I am not getting this or if you can provide any link for this to understand.

- Each user generates their own ssh key pair on their own workstation (in openssh, the command for generating a new key is called 'ssh-keygen')

- Each user then sends their public key to you (using email or whatever communication form is easiest for you).

- You then load the keys into gitolite (by copying them into your local clone of the gitolite-admin repo, committing, and pushing to the gitolite-admin repo to the server).

More details here: http://sitaramc.github.com/gitolite/add.html (and in associated documentation)

Quoted 6 lines

Jakub:
My reply: existing version control system used  pserver protocol.

You would still need for each user to generate their own SSH key. My reply: Do I need to store all end users sSH key in .ssh/authorized_keys file on GIT server?

No. You load them into gitolite (as described above, and in gitolite's documentation), and then gitolite takes care of managing them.

Have fun! :)

...Johan

Signature · 2 lines
Johan Herland, <[email protected]>
www.herland.net
#10 lore raw
In reply to supadhyay

Inline respon

Quoted 6 lines · supadhyay

Hi Robin and Jakub,
...
Robin:
All users must have their own SSH key. You do not create keys for them. My rely: can you please give some more idea about how it works.. I am not getting this or if you can provide any link for this to understand.

SSH authentication can use private/public keys. The user generates a keypair on their computer and gives you their public key, the private key stays on their computer.

Quoted 7 lines

Jakub:
My reply: existing version control system used  pserver protocol.

You would still need for each user to generate their own SSH key. My reply: Do I need to store all end users sSH key in .ssh/authorized_keys file on GIT server?

If you were to do it manually, yes. But if you use gitolite [1], then you add them to another git repository which handles everything for you.

Quoted 7 lines

--
View this message in context: http://git.661346.n2.nabble.com/User-authentication-in-GIT-tp7261349p7262113.html
Sent from the git mailing list archive at Nabble.com.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[1]: https://github.com/sitaramc/gitolite

#11 lore raw
In reply to supadhyay
Quoted 3 lines · supadhyay

I want to migrate my existing version control system (CVS) into GIT. The first question which comes to me is in CVS we have user authentication like username and their password while in GIT there is SSH authentication.

Do you use _unencrypted_ pserver, or tunelling over SSH (with CVS_RSH)?

Quoted 4 lines

Can any one suggest me what is the optimal way to manage the users in GIT? Does all users having username, passoword and SSH key? or there is no users credential but only SSH authentication? if I have 1000 users in old system CVS then do I need to create a key for all 1000 users in GIT? or etc.

First, Git supports unauthenticated anonymous fetching via custom
git:// protocol and via HTTP. If you only need read-only access to repository, it would be enough. No account or SSH key necessary.

Second, Git uses SSH for authenthication instead of hand-rolling its own security system, badly. You don't need to create 1000 shell accounts for SSH access: use tool like gitolite to manage git repositories, which uses public-key infrastructure without need to generate 1000 accounts. You would still need for each user to generate their own SSH key.

See gitolite documentation for more detail (older gitosis tool is no longer maintained, as far as I know).

HTH

Signature · 1 line
Jakub Narebski
#12 lore raw
In reply to supadhyay
Quoted 1 line · supadhyay

Hi All,

[snip]

1. Go and use gitolite.
2. All users must have their own SSH key. You do not create keys for them.

Signature · 4 lines
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : [email protected]
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
author
#5 lore raw

Hi Sitaram,

Thanks for helping me by providing such a good link. Now, I am able to understand how to manage the user in efficient way.

With that I have one question is- in my GIT server we already migrated our source code (pilot testing) from CVS to GIT. We used user "GITAdmin" for migration and though its for pilot testing only we use the home directory for source code repository is /home/GITAdmin/migration/VVD.git.

now the question is, I install gitolie using the same user "GITAdmin" and on the same path i.e. /home/GITAdmin. And when add repository from my workstation (git add conf/glitolite.conf) , this added repositories directory on the GIT server path /home/GITAdmin/repositories/MRB.git

Now my confusion is my existing source code repository directory path during migration /home/GITAdmin/migration/<repository.git> and now through gitolite I want to manage both users and repositories but through gitolite it add repository in different path /home/GITAdmin/repositories/<repository.git>.

Can you please help how through gitolite I can add new repository on to the same my exisitng migrated repository directory?

Thanks,
Suchi

--
View this message in context: http://git.661346.n2.nabble.com/User-authentication-in-GIT-tp7261349p7273350.html
Sent from the git mailing list archive at Nabble.com.

#6 lore raw
Quoted 8 lines · supadhyay

Now my confusion is my existing source code repository directory path during migration /home/GITAdmin/migration/<repository.git> and now through gitolite I want to manage both users and repositories  but through gitolite it add repository in different path /home/GITAdmin/repositories/<repository.git>.

Can you please help how through gitolite I can add new repository on to the same my exisitng migrated repository directory?

gitolite keeps all its repos in whatever directory is pointed to by $REPO_BASE in the rc file. This is $HOME/repositories by default but you can change it to whatever you want. Instructions for changing it are in the 4th bullet of
http://sitaramc.github.com/gitolite/rc.html#gitolite_rc_rarely_changed_variables_

If you are moving existing repos into gitolite, be sure to read
http://sitaramc.github.com/gitolite/moverepos.html -- if you do it wrong you may end up without the crucial "update" hook and then all access control will fail.

author
#9 lore raw

Thanks for suggesting the link, but would like to know which method is the most secure and optimal method to use.

For testing purpose we migrate our repositories from CVS2GIT but now having issue wiht user managment. How to manage it ? We have users for different repositories and having different access, somewhere I read about using Gitolite I can mange users but not find the efficent and useful method to use it.

Thanks .
..

--
View this message in context: http://git.661346.n2.nabble.com/User-authentication-in-GIT-tp7261349p7281349.html
Sent from the git mailing list archive at Nabble.com.