- Convenient access to setuid scripts
allows enabled users to easily manage 'setuid' scripts and binaries.
A directory containing scripts or other executables is created inside the
for each destination user. Any user is then able to invoke the script 'bob'
in the directory 'jo' via 'msudir jo/bob'. The script will be run under
the uid and primary gid of the destination user. (All other group memberships
are revoked). If the destination user cannot read the current working
directory it is set to '/'.
Configuration is specified in
must be owned by root and not writable by any other user. Each directory
inside the basedir and files inside must be owned by the destination
user or root, and also not writable by any other user.
contains lines of the form 'key = value'. If a line contains a '#' the rest
of that line is ignored. Options after a [tag] line will only apply to a
directory named 'tag', and will override any global options.
Valid directives are:
Base directory containing user directories and commands. Default:
Directory names must match user names. Default: true.
If set the source process must be running under this real or effective group
id, or have it in its current group access list. Default: unset.
PATH setting for all commands. Default: (spaces introduced for legibility) /usr/local/bin: /usr/local/sbin: /usr/pkg/bin: /usr/pkg/sbin: /usr/bin: /usr/sbin: /bin: /sbin: /usr/games: /usr/X11R6/bin
If a directory is to contain setuid root scripts, the directory name must match
rootdir. Default: no match
Only permit files that start with '#!'. Default: false.
Boolean variables (those that default to 'true' or 'false') can be set to
any of 'false', 'off', 'no', '0', or 'true', 'on', 'yes' and '1'.
alters the following environment variables:
Set to the previous value of
Set to the value in
Set to the username of the destination user.
also sanitises all environment variables and arguments replacing everything
except alphanumeric and "#%'+,-./:[email protected]_ with spaces, and removes
and similar variables.
Sample msudir.conf file:
# common defines
dirmatchuser = 1
# special options for one directory
dirmatchuser = 0
fromgroup = flenge
David Brownlee .
attempt to sanitise the environment and arguments passed it does
remove the need to write scripts that treat their input carefully.