coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: program that runs a given command under a given gid


From: Bruno Haible
Subject: Re: program that runs a given command under a given gid
Date: Sat, 26 May 2012 18:30:41 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Jann Horn wrote:
> From the sudo manpage:
> 
>        -g group    Normally, sudo sets the primary group to the one specified 
> by the passwd database for the user the command is being run as (by default, 
> root).  The -g
>                    (group) option causes sudo to run the specified command 
> with the primary group set to group.  To specify a gid instead of a group 
> name, use #gid.  When
>                    running commands as a gid, many shells require that the 
> '#' be escaped with a backslash ('\').  If no -u option is specified, the 
> command will be run as
>                    the invoking user (not root).  In either case, the primary 
> group will be set to group.

It would be nice, but doesn't work (on openSUSE at least):

$ id
uid=1000(bruno) gid=100(users) groups=100(users),33(video)
$ sudo -g '#33' /bin/pwd
Sorry, user bruno is not allowed to execute '/bin/pwd' as bruno:video on linuix.
$ sudo -g video /bin/pwd
Sorry, user bruno is not allowed to execute '/bin/pwd' as bruno:video on linuix.

Probably this could be changed in the /etc/sudoers file...

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]