[sudo-users] Issue with apt command after setting log_subcmd option in /etc/sudoers file

Todd C. Miller Todd.Miller at sudo.ws
Tue Mar 28 08:58:57 MDT 2023


On Tue, 28 Mar 2023 05:46:43 -0000, ronan.bertinhugault at orange.com wrote:

> On the other lines of the sudoers file regarding the Defaults item there is a
>  space each time:
> Defaults        env_reset
> Defaults        mail_badpass
> Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi
> n:/sbin:/bin:/snap/bin"
> Defaults        use_pty
> #Defaults       log_host, log_year
> Defaults        log_input, log_output, log_subcmds
> Defaults!/usr/bin/apt !log_subcmds
>
> If you can provide me highlight on the way sudo behave with or without a spac
> e, I will be very interested.

There are five types of Defaults settings:

    Defaults		- global default values
    Defaults at host	- host-specific default values
    Defaults:user	- user-specific default values
    Defaults!command	- command-specific default values
    Defaults>runuser	- runas-specific default values

The host, user, command or runuser can also be a list.  Space is
allowed before the host/user/command but not between "Defaults" and
the special character ('@', ':', '!' or '>').  This isn't really
clear from the sudoers manual--I'll try to rectify that.

> Regarding the sudo version, here are the detailed information:
> sudo --version
> Sudo version 1.9.9
> Sudoers policy plugin version 1.9.9
> Sudoers file grammar version 48
> Sudoers I/O plugin version 1.9.9
> Sudoers audit plugin version 1.9.9

That appears to be the latest version from Ubuntu.  I build my own
sudo packages for common systems, including the Ubuntu LTS releases.
These are available from https://www.sudo.ws/getting/packages/.

 - todd


More information about the sudo-users mailing list