Configuration Information
The sudoers
file can be quite
complicated. It is composed of two types of entries: aliases
(basically variables) and user specifications (which specify who
may run what). The installation installs a default configuration
that has no privileges installed for any user.
A couple of common configuration changes are to set the path for
the super user and to allow members of the wheel group to execute
all commands after providing their own credientials. Use the
following commands to create the /etc/sudoers.d/sudo
configuration file as the
root
user:
cat > /etc/sudoers.d/sudo << "EOF"
Defaults secure_path="/usr/sbin:/usr/bin"
%wheel ALL=(ALL) ALL
EOF
For details, see man
sudoers.
Note
The Sudo developers highly
recommend using the visudo program to edit the
sudoers
file. This will provide
basic sanity checking like syntax parsing and file permission
to avoid some possible mistakes that could lead to a vulnerable
configuration.
If PAM is installed on the
system, Sudo is built with
PAM support. In that case, issue
the following command as the root
user to create the PAM
configuration file:
cat > /etc/pam.d/sudo << "EOF"
# Begin /etc/pam.d/sudo
# include the default auth settings
auth include system-auth
# include the default account settings
account include system-account
# Set default environment variables for the service user
session required pam_env.so
# include system session defaults
session include system-session
# End /etc/pam.d/sudo
EOF
chmod 644 /etc/pam.d/sudo