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