Using Git without Sudo in many accounts

前端 未结 5 2075
说谎
说谎 2020-12-08 23:34

How can you use Git without Sudo in multiple accounts in one Ubuntu?

My Ubuntu has many accounts. The creation of new accounts has made Git inaccess

5条回答
  •  既然无缘
    2020-12-08 23:59

    Having the permissions of any executable set so that a normal user can overwrite the executable is a considerable security risk. (Try overwriting /usr/bin/git with a shell script that calls rm -rf $HOME.)

    Change the permissions back to 755 and make git owned by root:root again. (Ubuntu's package manager would reset the permissions on the next upgrade anyhow unless you used dpkg-statoverride(8))

    I agree with those who say that it may not be a good idea to have multiple users share one git repository. If you still think that it is necessary, consider setting up a new group, chgrp the directory holding the repository and all the files therein to that group andset the setgid bit on the directories. (The --shared parameter to git init may do some of this for you, too.) Then, add all the users to the group that should have commit rights.

提交回复
热议问题