1 Installation instructions for Sudo 1.6.8
2 ========================================
4 Sudo uses a `configure' script to probe the capabilities and type
5 of the system in question. In this release, `configure' takes many
6 more options than it did before. Please read this document fully
7 before configuring and building sudo. You may also wish to read the
8 file INSTALL.configure which explains more about the `configure' script.
10 Simple sudo installation
11 ========================
13 For most systems and configurations it is possible simply to:
15 0) If you are upgrading from a previous version of sudo
16 please read the info in the UPGRADE file before proceeding.
18 1) If you previously ran `configure' on a different host
19 you will probably want to do a `make distclean' to remove
20 the old `config.cache' file. Otherwise, `configure'
21 will complain and refuse to run. Alternately, one can
22 simply `rm config.cache'.
24 2) Read the `OS dependent notes' section for any particular
25 "gotchas" relating to your operating system.
27 3) `cd' to the source or build directory and type `./configure'
28 to generate a Makefile and config.h file suitable for
29 building sudo. Before you actually run configure you
30 should read the `Available configure options' section
31 to see if there are any special options you may want
34 4) Edit the configure-generated Makefile if you wish to
35 change any of the default paths (alternately you could
36 have changed the paths via options to `configure'.
38 5) Type `make' to compile sudo. If you are building sudo
39 in a separate build tree (apart from the sudo source)
40 GNU make will probably be required. If `configure' did
41 its job properly (and you have a supported configuration)
42 there won't be any problems. If this doesn't work, take
43 a look at the files TROUBLESHOOTING and PORTING for tips
44 on what might have gone wrong. Please mail us if you have a
45 fix or if you are unable to come up with a fix (address at EOF).
47 6) Type `make install' (as root) to install sudo, visudo, the
48 man pages, and a skeleton sudoers file. Note that the install
49 will not overwrite an existing sudoers file. You can also
50 install various pieces the package via the install-binaries,
51 install-man, and install-sudoers make targets.
53 7) Edit the sudoers file with `visudo' as necessary for your
54 site. You will probably want to refer the sample.sudoers
55 file and sudoers man page included with the sudo package.
57 8) If you want to use syslogd(8) to do the logging, you'll need
58 to update your /etc/syslog.conf file. See the sample.syslog.conf
59 file included in the distribution for an example.
61 Available configure options
62 ===========================
64 This section describes flags accepted by the sudo's `configure' script.
65 Defaults are listed in brackets after the description.
69 Cache test results in FILE
72 Alias for `--cache-file=config.cache'
75 Print the usage/help info
78 Do not create output files
81 Do not print `checking...' messages
83 Directory and file names:
85 Install architecture-independent files in PREFIX This really only
86 applies to man pages. [/usr/local]
89 Install architecture-dependent files in EPREFIX This includes the
90 sudo and visudo executables. [same as prefix]
93 Install `sudo' in DIR [EPREFIX/bin]
96 Install `visudo' in DIR [EPREFIX/sbin]
99 Install `sudoers' file in DIR [/etc]
102 Install man pages in DIR [PREFIX/man]
105 Find the sources in DIR [configure dir or ..]
107 Special features/options:
109 Specifies path to C compiler you wish to use.
112 Adds the specified directory (or directories) to CPPFLAGS
113 so configure and the compiler will look there for include
114 files. Multiple directories may be specified as long as
115 they are space separated.
116 Eg: --with-incpath="/usr/local/include /opt/include"
119 Adds the specified directory (or directories) to LDFLAGS
120 so configure and the compiler will look there for libraries.
121 Multiple directories may be specified as with --with-incpath.
124 Tells configure to use -Rpath in addition to -Lpath when
125 passing library paths to the loader. This option is on
126 by default for Solaris and SVR4.
128 --with-blibpath[=PATH]
129 Tells configure to construct a -blibpath argument to the
130 loader. If a PATH is specified, it will be used as the
131 base. Otherwise, "/usr/lib:/lib:/usr/local/lib" will be
132 used for gcc and "/usr/lib:/lib" for non-gcc. Additional
133 library paths will be appended as needed by configure.
134 This option is only valid for AIX where it is on by default.
136 --with-libraries=LIBRARY
137 Adds the specified library (or libaries) to SUDO_LIBS and
138 and VISUDO_LIBS so sudo will link against them. If the
139 library doesn't start with `-l' or end in `.a' or `.o' a
140 `-l' will be prepended to it. Multiple libraries may be
141 specified as long as they are space separated.
144 Add CSOps standard options. You probably aren't interested in this.
147 Enable S/Key OTP (One Time Password) support. If specified,
148 DIR should contain include and lib directories with skey.h
149 and libskey.a respectively.
152 Enable NRL OPIE OTP (One Time Password) support. If specified,
153 DIR should contain include and lib directories with opie.h
154 and libopie.a respectively.
157 Enable SecurID support. If specified, DIR is directory containing
158 sdiclient.a, sdi_athd.h, sdconf.h, and sdacmvls.h.
161 Enable TIS Firewall Toolkit (FWTK) 'authsrv' support. If specified,
162 DIR is the base directory containing the compiled FWTK package
163 (or at least the library and header files).
166 Enable Kerberos IV support. If specified, DIR is the base
167 directory containing the Kerberos IV include and lib dirs.
168 This uses Kerberos passphrases for authentication but does
169 not use the Kerberos cookie scheme.
172 Enable Kerberos V support. If specified, DIR is the base
173 directory containing the Kerberos V include and lib dirs.
174 This This uses Kerberos passphrases for authentication but
175 does not use the Kerberos cookie scheme. Will not work for
176 Kerberos V older than version 1.1.
179 Enable LDAP support. If specified, DIR is the base directory
180 containing the LDAP include and lib directories. Please see
181 README.LDAP for more information.
183 --with-ldap-conf-file
184 Path to LDAP configuration file. If specified, sudo reads
185 this file instead of /etc/ldap.conf to locate the LDAP server.
188 Enable support for the AIX 4.x general authentication function.
189 This will use the authentication scheme specified for the user
193 Enable PAM support. Tested on:
197 NOTE: on RedHat Linux and Fedora you *must* have an /etc/pam.d/sudo
198 file install. You may either use the sample.pam file included with
199 sudo or use /etc/pam.d/su as a reference. The sample.pam file
200 included with sudo may or may not work with other Linux distributions.
201 On Solaris and HP-UX 11 systems you should check (and understand)
202 the contents of /etc/pam.conf. Do a "man pam.conf" for more
203 information and consider using the "debug" option, if available,
204 with your PAM libraries in /etc/pam.conf to obtain syslog output
205 for debugging purposes.
208 Enable AFS support with Kerberos authentication. Should work under
209 AFS 3.3. If your AFS doesn't have -laudit you should be able to
213 Enable DCE support for systems without PAM. Known to work on
214 HP-UX 9.X, 10.X, and 11.0; other systems may require source
215 code and/or `configure' changes. On systems with PAM support
216 (such as HP-UX 11.0 and higher, Solaris, FreeBSD and Linux), the
217 DCE PAM module (usually libpam_dce) should be used instead.
220 Enable support for BSD login classes where available (OS-dependent).
221 This adds support for the login classes specified in /etc/login.conf.
222 By default, a login class is not applied unless the 'use_loginclass'
223 option is defined in sudoers or the user specifies a class on the
227 Enable support for BSD authentication on BSD/OS and OpenBSD.
228 This option implies --with-logincap. It is not possible
229 to mix BSD authentication with other authentication methods
230 (and there really should be no need to do so). Note that
231 only the newer BSD authentication API is supported. If you
232 don't have /usr/include/bsd_auth.h then you cannot use this.
235 Enable support for the "noexec" functionality which prevents
236 a dynamically-linked program being run by sudo from executing
237 another program (think shell escapes). Please see the
238 "PREVENTING SHELL ESCAPES" section in the sudoers man page
239 for details. If specified, PATH should be a fully qualified
240 pathname, e.g. /usr/local/libexec/sudo_noexec.so. If PATH
241 is "no", noexec support will not be compiled in. The default
242 is to compile noexec support if libtool supports building
243 shared objects on your OS.
245 --disable-root-mailer
246 By default sudo will run the mailer as root when tattling
247 on a user so as to prevent that user from killing the mailer.
248 With this option, sudo will run the mailer as the invoking
249 user which some people consider to be safer.
252 Disable use of POSIX saved IDs. Normally, sudo will try
253 to use POSIX saved IDs if they are supported. However,
254 some implementations are broken.
257 Disable use of the setreuid() function for operating systems
258 where it is broken. 4.4BSD has setreuid() but it doesn't
262 Disable use of the setresuid() function for operating systems
263 where it is broken (none currently known).
266 Disable SIA support. This is the "Security Integration
267 Architecture" on Digital UNIX. If you disable SIA sudo will
268 use its own authentication routines.
271 Disable shadow password support. Normally, sudo will compile
272 in shadow password support and use a shadow password if it
275 --with-sudoers-mode=MODE
276 File mode for the sudoers file (octal). Note that if you
277 wish to NFS-mount the sudoers file this must be group
278 readable. Also note that this is actually set in the
279 Makefile. The default mode is 0440.
281 --with-sudoers-uid=UID
282 User id that "owns" the sudoers file. Note that this is
283 the numeric id, *not* the symbolic name. Also note that
284 this is actually set in the Makefile. The default is 0.
286 --with-sudoers-gid=GID
287 Group id that "owns" the sudoers file. Note that this is
288 the numeric id, *not* the symbolic name. Also note that
289 this is actually set in the Makefile. The default is 0.
292 Use execv() to exec the command instead of execvp(). I can't think of
293 a reason to actually do this since execvp() is passed a fully qualified
294 pathname but someone might thoroughly distrust execvp(). Note that if
295 you define this you lose the ability to exec scripts that are missing
296 the '#!/bin/sh' cookie (like /bin/kill on SunOS and /etc/fastboot on
297 4.3BSD). This is off by default.
300 This option keeps sudo from trying to glean the ip address
301 from each attached ethernet interface. It is only useful
302 on a machine where sudo's interface reading support does
303 not work, which may be the case on some SysV-based OS's
307 This option excludes authentication via the passwd (or
308 shadow) file. It should only be used when another, alternate,
309 authentication scheme is in use.
312 This option is now just an alias for --without-passwd.
315 Properly handle GNU stow packaging. The sudoers file will
316 physically live in ${prefix}/etc and /etc/sudoers will be
319 The following options are also configurable at runtime:
321 --with-long-otp-prompt
322 When validating with a One Time Password scheme (S/Key or
323 OPIE), a two-line prompt is used to make it easier to cut
324 and paste the challenge to a local window. It's not as
325 pretty as the default but some people find it more convenient.
328 How you want to do your logging. You may choose "syslog",
329 "file", or "both". Setting this to "syslog" is nice because
330 you can keep all of your sudo logs in one place (see the
331 sample.syslog.conf file). The default is "syslog".
333 --with-logfac=FACILITY
334 Determines which syslog facility to log to. This requires
335 a 4.3BSD or later version of syslog. You can still set
336 this for ancient syslogs but it will have no effect. The
337 following facilities are supported: authpriv (if your OS
338 supports it), auth, daemon, user, local0, local1, local2,
339 local3, local4, local5, local6, and local7.
341 --with-goodpri=PRIORITY
342 Determines which syslog priority to log successfully
343 authenticated commands. The following priorities are
344 supported: alert, crit, debug, emerg, err, info, notice,
347 --with-badpri=PRIORITY
348 Determines which syslog priority to log unauthenticated
349 commands and errors. The following priorities are supported:
350 alert, crit, debug, emerg, err, info, notice, and warning.
353 Override the default location of the sudo log file and use
354 "path" instead. By default will use /var/log/sudo.log if
355 there is a /var/log dir, falling back to /var/adm/sudo.log
356 or /usr/adm/sudo.log if not.
359 Number of characters per line for the file log. This is only used if
360 you are to "file" or "both". This value is used to decide when to wrap
361 lines for nicer log files. The default is 80. Setting this to 0
362 will disable the wrapping.
365 If set, sudo will ignore '.' or '' (current dir) in $PATH.
366 The $PATH itself is not modified.
368 --with-mailto=USER|MAIL_ALIAS
369 User (or mail alias) that mail from sudo is sent to.
370 This should go to a sysadmin at your site. The default is "root".
372 --with-mailsubject="SUBJECT OF MAIL"
373 Subject of the mail sent to the "mailto" user. The token "%h"
374 will expand to the hostname of the machine.
375 Default is "*** SECURITY information for %h ***".
377 --without-mail-if-no-user
378 Normally, sudo will mail to the "alertmail" user if the user invoking
379 sudo is not in the sudoers file. This option disables that behavior.
381 --with-mail-if-no-host
382 Send mail to the "alermail" user if the user exists in the sudoers
383 file, but is not allowed to run commands on the current host.
385 --with-mail-if-noperms
386 Send mail to the "alermail" user if the user is allowed to use sudo but
387 the command they are trying is not listed in their sudoers file entry.
389 --with-passprompt="PASSWORD PROMPT"
390 Default prompt to use when asking for a password; can be overridden
391 via the -p option and the SUDO_PROMPT environment variable. Supports
392 two escapes: "%u" expands to the user's login name and "%h" expands
393 to the local hostname. Default is "Password:".
395 --with-badpass-message="BAD PASSWORD MESSAGE"
396 Message that is displayed if a user enters an incorrect password.
397 The default is "Sorry, try again." unless insults are turned on.
400 Define this if you want to put fully qualified hostnames in the sudoers
401 file. Ie: instead of myhost you would use myhost.mydomain.edu. You may
402 still use the short form if you wish (and even mix the two). Beware
403 that turning FQDN on requires sudo to make DNS lookups which may make
404 sudo unusable if your DNS is totally hosed. Also note that you must
405 use the host's official name as DNS knows it. That is, you may not use
406 a host alias (CNAME entry) due to performance issues and the fact that
407 there is no way to get all aliases from DNS.
410 Override the default location of the sudo timestamp directory and
414 Override configure's guess as to the location of sendmail.
417 Do not use sendmail to mail messages to the "mailto" user.
418 Use only if don't run sendmail or the equivalent.
421 Umask to use when running the root command. The default is 0022.
424 Preserves the umask of the user invoking sudo.
426 --with-runas-default=USER
427 The default user to run commands as if the -u flag is not specified
428 on the command line. This defaults to "root".
431 Users in the specified group don't need to enter a password when
432 running sudo. This may be useful for sites that don't want their
433 "core" sysadmins to have to enter a password but where Jr. sysadmins
434 need to. You should probably use NOPASSWD in sudoers instead.
436 --with-passwd-tries=NUMBER
437 Number of tries a user gets to enter his/her password before sudo logs
438 the failure and exits. The default is 3.
440 --with-timeout=NUMBER
441 Number of minutes that can elapse before sudo will ask for a passwd
442 again. The default is 5, set this to 0 to always prompt for a password.
444 --with-password-timeout=NUMBER
445 Number of minutes before the sudo password prompt times out.
446 The default is 5, set this to 0 for no password timeout.
449 This makes sudo use a different ticket file for each user/tty combo.
450 Ie: instead of the ticket path being "username" it is "username/tty".
451 This is useful for "shared" accounts like "operator". Note that this
452 means that there will be more files in the timestamp dir. This is not
453 a problem if your system has a cron job to remove of files from /tmp
454 (or wherever you specified the timestamp dir to be).
457 Define this if you want to be insulted for typing an incorrect password
458 just like the original sudo(8). This is off by default.
461 Include all the insult sets listed below. You must either specify
462 --with-insults or enable insults in the sudoers file for this to
465 --with-classic-insults
466 Uses insults from sudo "classic." If you just specify --with-insults
467 you will get the classic and CSOps insults. This is on by default if
468 --with-insults is given.
471 Insults the user with an extra set of insults (some quotes, some
472 original) from a sysadmin group at CU (CSOps). You must specify
473 --with-insults as well for this to have any effect. This is on by
474 default if --with-insults is given.
477 Uses 2001-like insults when an incorrect password is entered.
478 You must either specify --with-insults or enable insults in the
479 sudoers file for this to have any effect.
482 Insults the user with lines from the "Goon Show" when an incorrect
483 password is entered. You must either specify --with-insults or
484 enable insults in the sudoers file for this to have any effect.
487 Replace politically incorrect insults with less objectionable ones.
489 --with-secure-path[=PATH]
490 Path used for every command run from sudo(8). If you don't trust the
491 people running sudo to have a sane PATH environment variable you may
492 want to use this. Another use is if you want to have the "root path"
493 be separate from the "user path." You will need to customize the path
494 for your site. NOTE: this is not applied to users in the group
495 specified by --with-exemptgroup. If you do not specify a path,
496 "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc" is used.
499 Don't print the lecture the first time a user runs sudo.
502 Specify the default editor path for use by visudo. This may be a
503 single pathname or a colon-separated list of editors. In the latter
504 case, visudo will choose the editor that matches the user's VISUAL
505 or EDITOR environment variables or the first editor in the list that
506 exists. The default is the path to vi on your system.
509 Makes visudo consult the VISUAL and EDITOR environment variables before
510 falling back on the default editor list (as specified by --with-editor).
511 Note that this may create a security hole as it allows the user to
512 run any arbitrary command as root without logging. A safer alternative
513 is to use a colon-separated list of editors with the --with-editor
514 option. visudo will then only use the VISUAL or EDITOR variables
515 if they match a value specified via --with-editor.
517 --disable-authentication
518 By default, sudo requires the user to authenticate via a
519 password or similar means. This options causes sudo to
520 *not* require authentication. It is possible to turn
521 authentication back on in sudoers via the PASSWD attribute.
524 Don't let root run sudo. This can be used to prevent people from
525 "chaining" sudo commands to get a root shell by doing something
526 like "sudo sudo /bin/sh".
529 Log the hostname in the log file.
531 --enable-noargs-shell
532 If sudo is invoked with no arguments it acts as if the "-s" flag had
533 been given. That is, it runs a shell as root (the shell is determined
534 by the SHELL environment variable, falling back on the shell listed
535 in the invoking user's /etc/passwd entry).
537 --enable-shell-sets-home
538 If sudo is invoked with the "-s" flag the HOME environment variable
539 will be set to the home directory of the target user (which is root
540 unless the "-u" option is used). This option effectively makes the
541 "-s" flag imply "-H".
544 Normally, sudo will tell the user when a command could not be found
545 in their $PATH. Some sites may wish to disable this as it could
546 be used to gather information on the location of executables that
547 the normal user does not have access to. The disadvantage is that
548 if the executable is simply not in the user's path, sudo will tell
549 the user that they are not allowed to run it, which can be confusing.
551 Shadow password and C2 support
552 ==============================
554 Shadow passwords (also included with most C2 security packages) are
555 supported on most major platforms for which they exist. The
556 `configure' script will attempt to determine if your system can use
557 shadow passwords and include support for them if so. Shadow password
558 support is now compiled in by default (it doesn't hurt anything if you
559 don't have them configured). To disable the shadow password support,
560 use the --disable-shadow option to configure.
562 Shadow passwords are known to work on the following platforms:
571 ConvexOS with C2 security (not tested recently)
576 SVR4 (and variants using standard SVR4 shadow passwords)
577 4.4BSD based systems (including OpenBSD, NetBSD, FreeBSD, and BSD/OS)
578 OS's using SecureWare's C2 security.
583 OpenBSD < 2.2 and NetBSD < 1.2.1:
584 The fdesc file system has a bug wrt /dev/tty handling that
585 causes sudo to hang at the password prompt. The workaround
586 is to run configure with --with-password-timeout=0
589 You need to have a C compiler in order to build sudo.
590 Since Solaris 2.x does not come with one by default this
591 means that you either need to have purchased the unbundled Sun
592 C compiler or have a copy of the GNU C compiler (gcc).
593 The SunSoft Catalyst CD should contain gcc binaries for
594 Solaris. You can also get them from various places on the
595 net, including http://www.sunfreeware.com/
596 NOTE: sudo will *not* build with the sun C compiler in BSD
597 compatibility mode (/usr/ucb/cc). Sudo is designed to
598 compile with the standard C compiler (or gcc) and will
599 not build correctly with /usr/ucb/cc. You can use the
600 `--with-CC' option to point `configure' to the non-ucb
601 compiler if it is not the first cc in your path. Some
602 sites link /usr/ucb/cc to gcc; configure will not notice
603 this an still refuse to use /usr/ucb/cc, so make sure gcc
604 is also in your path if your site is setup this way.
605 Also: Many versions of Solaris come with a broken syslogd.
606 If you have having problems with sudo logging you should
607 make sure you have the latest syslogd patch installed.
608 This is a problem for Solaris 2.4 and 2.5 at least.
611 I've had various problems with the AIX C compiler producing
612 incorrect code when the -O flag was used. When optimization
613 is not used, the problems go away. Gcc does not appear
614 to have this problem.
616 Also, the AIX 3.2.x lex will not work with sudo's parse.lex.
617 This should not be a problem as sudo comes shipped with
618 a pre-generated lex.yy.c (created by flex). If you want
619 to modify the lex tokenizer, make sure you grab a copy of
620 flex from ftp.ee.lbl.gov (also available on most GNU mirrors)
621 and sudo will use that instead.
624 Ultrix still ships with the 4.2BSD syslog(3) which does not
625 allow things like logging different facilities to different
626 files, redirecting logs to a single loghost and other niceties.
627 You may want to just grab and install:
628 ftp://gatekeeper.dec.com/pub/DEC/jtkohl-syslog-complete.tar.Z
629 (available via anonymous ftp) which is a port if the 4.3BSD
630 syslog/syslogd that is backwards compatible with the Ultrix version.
631 I recommend it highly. If you do not do this you probably want
632 to run configure with --with-logging=file
635 By default, sudo will use SIA (Security Integration Architecture)
636 to validate a user. If you want to use an alternate authentication
637 method that does not go through SIA, you need to use the
638 --disable-sia option to configure. If you use gcc to compile
639 you will get warnings when building interfaces.c. These are
640 harmless but if they really bug you, you can edit
641 /usr/include/net/if.h around line 123, right after the comment:
642 /* forward decls for C++ */
646 #if defined(__cplusplus) || defined(__GNUC__)
647 If you don't like the idea of editing the system header file
648 you can just make a copy in gcc's private include tree and
652 NOTE: Reportedly, Linux's execvp(3) doesn't always execute
653 scripts that lack the "#!/some/shell" header correctly.
654 The workaround is to give all your scripts a proper
656 Versions of glibc 2.x previous to 2.0.7 have a broken lsearch().
657 You will need to either upgrade to glibc-2.0.7 or use sudo's
658 version of lsearch(). To use sudo's lsearch(), comment out
659 the "#define HAVE_LSEARCH 1" line in config.h and add lsearch.o
660 to the LIBOBJS line in the Makefile.
662 If you are using a Linux kernel older than 2.4 it is not possible
663 to access the sudoers file via NFS. This is due to a bug in
664 the Linux client-side NFS implementation that has since been
665 fixed. There is a workaround on the sudo ftp site, linux_nfs.patch,
666 if you need to NFS-mount sudoers on older Linux kernels.
668 Linux kernels 2.2.16-2.2.19 appear to have broken POSIX saved
669 ID support. You must run configure with the --disable-saved-ids
670 flag to get a working sudo.
673 It has been reported that for sudo to work on Mac OS X it must
674 either be built with the --with-password-timeout=0 option or the
675 password timeout must be disabled in the Defaults line in the
676 sudoers file. If sudo just hangs when you try to enter a password,
677 you need to disable the password timeout (Note: this is not a bug
681 You'll probably need libcrypt_i.a available via anonymous ftp
682 from sosco.sco.com. The necessary files are /SLS/lng225b.Z
683 and /SLS/lng225b.ltr.Z.
686 Some people have experienced problems building sudo with gcc
687 on Dynix. If you experience problems compiling sudo using gcc
688 on Dynix, try using the native compiler (cc). You can do so
689 by removing the config.cache file and then re-running configure
690 with the --with-CC=cc option.
693 The default C compiler shipped with HP-UX does not support creating
694 position independent code and so is unable to support sudo's "noexec"
695 functionality. You must use either the HP ANSI C compiler or gcc for
696 noexec to work. Binary packages of gcc are available from
697 http://hpux.connect.org.uk/ and http://hpux.cs.utah.edu/.