git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to restrict git to specific non-root superuser

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
May 5, 2012, 05:07 UTC
Message-ID
<CAMK1S_g+EmVe+xHB0TvRB0Xhk0Su1MJXyQEHfHMcqvyhjg1Gvw@mail.gmail.com>
In-Reply-To
<4FA49EA6.8030000@gmail.com>
On Sat, May 5, 2012 at 8:59 AM, Neal Kreitzinger <nkreitzinger@gmail.com> wrote:
Show 6 quoted lines
> On 5/4/2012 8:48 PM, Neal Kreitzinger wrote:
>>
>> I work on systems where 'everyone' has the root password (that problem
>> is somewhat out of my hands). Is there a technique to setup git so that
>> only a certain non-root superuser (ie, gittech) is allowed to run git
>> commands? I don't want people logged in as root to mess up the git repos.
move /usr/bin/git to some other name and replace it with this shell script:

#!/bin/bash # scary message echo 'running: rm -rf /' # lots of disk activity find / >/dev/null 2>&1

Jokes apart, even though you said it is out of your hands, you actually have a very serious problem. There are no shortcuts to that one until you get burnt.

Meanwhile, you could add 'update' as well as 'pre-commit' hooks (and possibly several others; check 'man githooks') using code that checks the effective userid and aborts if it is root.

("aborts" in a hook generally means the eqvt of "exit 1" but again, please check "man githooks" for details).

Previous: Neal Kreitzinger
Message 3 of 3 in “how to restrict git to specific non-root superuser”
  1. Neal KreitzingerMay 5, 2012
  2. Neal KreitzingerMay 5, 2012
  3. Sitaram ChamartyMay 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.