• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H03-May-2022-45,54244,514

etc/H03-May-2022-1,1601,052

examples/H03-May-2022-703314

include/H03-May-2022-6,6484,020

lib/H03-May-2022-52,79237,695

logsrvd/H03-May-2022-12,2069,485

m4/H03-May-2022-10,4779,515

plugins/H03-May-2022-187,075147,911

po/H03-May-2022-35,83728,559

scripts/H03-May-2022-25,14119,475

src/H03-May-2022-19,21414,435

ABOUT-NLSH A D20-Sep-202193.9 KiB1,4071,368

ChangeLogH A D21-Sep-20211.9 MiB66,62951,999

INSTALLH A D20-Sep-202141.3 KiB1,014835

INSTALL.configureH A D20-Sep-202115.2 KiB366284

MANIFESTH A D20-Sep-202138.5 KiB1,1461,145

Makefile.inH A D20-Sep-202114.1 KiB443356

NEWSH A D21-Sep-2021146.8 KiB3,6342,620

READMEH A D20-Sep-20213.2 KiB8567

README.LDAPH A D20-Sep-20217.8 KiB206150

aclocal.m4H A D20-Sep-20211.1 KiB2924

autogen.shH A D20-Sep-2021476 2112

config.h.inH A D20-Sep-202140.8 KiB1,4781,045

configureH A D21-Sep-2021893.7 KiB33,46227,517

configure.acH A D21-Sep-2021162.5 KiB5,2934,962

pathnames.h.inH A D20-Sep-20216.7 KiB261214

README

1The sudo philosophy
2===================
3Sudo is a program designed to allow a sysadmin to give limited root privileges
4to users and log root activity.  The basic philosophy is to give as few
5privileges as possible but still allow people to get their work done.
6
7Where to find sudo
8==================
9Before you try and build sudo, *please* make sure you have the current
10version.  The latest sudo may always be gotten via anonymous ftp from
11ftp.sudo.ws in the directory /pub/sudo/ or from the sudo web site,
12https://www.sudo.ws/
13
14The distribution is sudo-M.m.tar.gz where `M' is the major version
15number and `m' is the minor version number.  BETA versions of sudo may
16also be available.  If you join the `sudo-workers' mailing list you
17will get the BETA announcements (see the `Mailing lists' section below).
18
19What's new
20==========
21See the NEWS file for a list of major changes in this release.
22For a complete list of changes, see the ChangeLog file.  For a
23summary of major changes to the current stable release, see the web
24page, https://www.sudo.ws/stable.html.
25
26If you are upgrading from an earlier version of Sudo, please see
27the UPGRADE file in the doc directory.
28
29For a history of sudo please see the HISTORY file in the doc directory.
30You can find a list of contributors to sudo in the doc/CONTRIBUTORS file.
31
32Building the release
33====================
34Please read the installation guide in the `INSTALL' file before trying to
35build sudo.  Pay special attention to the "OS dependent notes" section.
36
37Copyright
38=========
39Sudo is distributed under an ISC-style license.
40Please refer to the `LICENSE' file included with the release for details.
41
42Mailing lists
43=============
44sudo-announce	This list receives announcements whenever a new version
45		of sudo is released.
46		https://www.sudo.ws/mailman/listinfo/sudo-announce
47
48sudo-blog	This list receives a message when a new sudo blog
49		article is available.
50		https://www.sudo.ws/mailman/listinfo/sudo-blog
51
52sudo-commits	This list receives a message for each commit made to
53		the sudo source repository.
54		https://www.sudo.ws/mailman/listinfo/sudo-commits
55
56sudo-users	This list is for questions and general discussion about sudo.
57		https://www.sudo.ws/mailman/listinfo/sudo-users
58
59sudo-workers	This list is for people working on and porting sudo.
60		https://www.sudo.ws/mailman/listinfo/sudo-workers
61
62To subscribe to a list, visit its url (as listed above) and enter
63your email address to subscribe.  Digest versions are available but
64these are fairly low traffic lists so the digest versions are not
65a significant win.
66
67Mailing list archives are also available.  See the mailing list web sites
68for the appropriate links.
69
70Web page
71========
72There is a sudo web page at https://www.sudo.ws/ that contains an
73overview of sudo, documentation, downloads, a bug tracker, information
74about beta versions and other useful info.
75
76Bug reports
77===========
78If you have found what you believe to be a bug, you can file a bug
79report in the sudo bug database, on the web at https://bugzilla.sudo.ws/.
80
81Please read over the `TROUBLESHOOTING' file in the doc directory *before*
82submitting a bug report.  When reporting bugs, please be sure to include
83the version of sudo you are using as well as the platform you are running
84it on.
85

README.LDAP

1This file explains how to build the optional LDAP functionality of SUDO to
2store /etc/sudoers information.  This feature is distinct from LDAP passwords.
3
4For general sudo LDAP configuration details, see the sudoers.ldap manual that
5comes with the sudo distribution.  A pre-formatted version of the manual may
6be found in the sudoers.ldap.cat file.
7
8The sudo binary compiled with LDAP support should be totally backward
9compatible and be syntactically and source code equivalent to its
10non LDAP-enabled build.
11
12LDAP philosophy
13===============
14As times change and servers become cheap, an enterprise can easily have 500+
15UNIX servers.  Using LDAP to synchronize Users, Groups, Hosts, Mounts, and
16others across an enterprise can greatly reduce the administrative overhead.
17
18In the past, sudo has used a single local configuration file, /etc/sudoers.
19While the same sudoers file can be shared among machines, no built-in
20mechanism exists to distribute it.  Some have attempted to workaround this
21by synchronizing changes via CVS/RSYNC/RDIST/RCP/SCP and even NFS.
22
23By using LDAP for sudoers we gain a centrally administered, globally
24available configuration source for sudo.
25
26For information on OpenLDAP, please see http://www.openldap.org/.
27
28Definitions
29===========
30Many times the word 'Directory' is used in the document to refer to the LDAP
31server, structure and contents.
32
33Many times 'options' are used in this document to refer to sudoer 'defaults'.
34They are one and the same.
35
36Build instructions
37==================
38The simplest way to build sudo with LDAP support is to include the
39'--with-ldap' option.
40
41  $ ./configure --with-ldap
42
43If your ldap libraries and headers are in a non-standard place, you will need
44to specify them at configure time.  E.g.
45
46  $ ./configure --with-ldap=/usr/local/ldapsdk
47
48Sudo is developed using OpenLDAP but Netscape-based LDAP libraries
49(such as those present in Solaris) are also known to work.
50
51Your mileage may vary.  Please let the sudo workers mailing list
52<sudo-workers@sudo.ws> know if special configuration was required
53to build an LDAP-enabled sudo so we can improve sudo.
54
55Schema Changes
56==============
57You must add the appropriate schema to your LDAP server before it
58can store sudoers content.
59
60For OpenLDAP, there are two options, depending on how slapd is configured.
61
62The first option is to copy the file schema.OpenLDAP to the schema
63directory (e.g. /etc/openldap/schema).  You must then edit your
64slapd.conf and add an include line the new schema, e.g.
65
66    # Sudo LDAP schema
67    include	/etc/openldap/schema/sudo.schema
68
69In order for sudoRole LDAP queries to be efficient, the server must index
70the attribute 'sudoUser', e.g.
71
72    # Indices to maintain
73    index	sudoUser	eq
74
75After making the changes to slapd.conf, restart slapd.
76
77The second option is only for OpenLDAP 2.3 and higher where slapd.conf
78has been configured to use on-line configuration.  If your slapd.conf
79file includes the line:
80
81    database config
82
83it should be possible to use the schema.olcSudo file.
84
85You can apply schema.olcSudo using the ldapadd utility or another
86suitable LDAP browser.  For example:
87
88    # ldapadd -f schema.olcSudo -H ldap://ldapserver -W -x \
89	-D cn=Manager,dc=example,dc=com
90
91There is no need to restart slapd when updating on-line configuration.
92
93For Netscape-derived LDAP servers such as SunONE, iPlanet or Fedora Directory,
94copy the schema.iPlanet file to the schema directory with the name 99sudo.ldif.
95
96On Solaris, schemas are stored in /var/Sun/mps/slapd-`hostname`/config/schema/.
97For Fedora Directory Server, they are stored in /etc/dirsrv/schema/.
98
99After copying the schema file to the appropriate directory, restart
100the LDAP server.
101
102Finally, using an LDAP browser/editor, enable indexing by editing the
103client profile to provide a Service Search Descriptor (SSD) for sudoers,
104replacing example.com with your domain:
105
106    serviceSearchDescriptor: sudoers: ou=sudoers,dc=example,dc=com
107
108If using an Active Directory server, copy schema.ActiveDirectory
109to your Windows domain controller and run the following command:
110
111    ldifde -i -f schema.ActiveDirectory -c dc=X dc=example,dc=com
112
113Importing /etc/sudoers into LDAP
114================================
115Importing sudoers is a two-step process.
116
117Step 1:
118Ask your LDAP Administrator where to create the ou=SUDOers container.
119
120For instance, if using OpenLDAP:
121
122  dn: ou=SUDOers,dc=example,dc=com
123  objectClass: top
124  objectClass: organizationalUnit
125  ou: SUDOers
126
127(An example location is shown below).  Then use the cvtsudoers utility to
128convert your sudoers file into LDIF format.
129
130  # SUDOERS_BASE=ou=SUDOers,dc=example,dc=com
131  # export SUDOERS_BASE
132  # cvtsudoers -f ldif -o /tmp/sudoers.ldif /etc/sudoers
133
134Step 2:
135Import into your directory server.  The following example is for
136OpenLDAP.  If you are using another directory, provide the LDIF
137file to your LDAP Administrator.
138
139  # ldapadd -f /tmp/sudoers.ldif -H ldap://ldapserver \
140    -D cn=Manager,dc=example,dc=com -W -x
141
142Step 3:
143Verify the sudoers LDAP data:
144
145  # ldapsearch -b "$SUDOERS_BASE" -D cn=Manager,dc=example,dc=com -W -x
146
147Managing LDAP entries
148=====================
149Doing a one-time bulk load of your ldap entries is fine.  However what if you
150need to make minor changes on a daily basis?  It doesn't make sense to delete
151and re-add objects.  (You can, but this is tedious).
152
153I recommend using any of the following LDAP browsers to administer your SUDOers.
154  * GQ - The gentleman's LDAP client - Open Source - I use this a lot on Linux
155    and since it is Schema aware, I don't need to create a sudoRole template.
156	http://sourceforge.net/projects/gqclient/
157
158  * phpQLAdmin - Open Source - phpQLAdmin is an administration tool,
159    originally for QmailLDAP, that supports editing sudoRole objects
160    in version 2.3.2 and higher.
161	http://phpqladmin.com/
162
163  * LDAP Browser/Editor - by Jarek Gawor - I use this a lot on Windows
164    and Solaris.  It runs anywhere in a Java Virtual Machine including
165    web pages.  You have to make a template from an existing sudoRole entry.
166	http://www.iit.edu/~gawojar/ldap
167	http://www.mcs.anl.gov/~gawor/ldap
168	http://ldapmanager.com
169
170  * Apache Directory Studio - Open Source - an Eclipse-based LDAP
171    development platform.  Includes an LDAP browser, and LDIF editor,
172    a schema editor and more.
173    http://directory.apache.org/studio
174
175  There are dozens of others, some Open Source, some free, some not.
176
177Configure your /etc/ldap.conf and /etc/nsswitch.conf
178====================================================
179The /etc/ldap.conf file is meant to be shared between sudo, pam_ldap, nss_ldap
180and other ldap applications and modules.  IBM Secureway unfortunately uses
181the same file name but has a different syntax.  If you need to change where
182this file is stored, re-run configure with the --with-ldap-conf-file=PATH
183option.
184
185See the "Configuring ldap.conf" section in the sudoers.ldap manual
186for a list of supported ldap.conf parameters and an example ldap.conf
187
188Make sure you sudoers_base matches the location you specified when you
189imported the sudoers ldif data.
190
191After configuring /etc/ldap.conf, you must add a line in /etc/nsswitch.conf
192to tell sudo to look in LDAP for sudoers.  See the "Configuring nsswitch.conf"
193section in the sudoers.ldap manual for details.  Note that sudo will use
194/etc/nsswitch.conf even if the underlying operating system does not support it.
195To disable nsswitch support, run configure with the --with-nsswitch=no option.
196This will cause sudo to consult LDAP first and /etc/sudoers second, unless the
197ignore_sudoers_file flag is set in the global LDAP options.
198
199Debugging your LDAP configuration
200=================================
201Enable debugging if you believe sudo is not parsing LDAP the way you think it
202should.  Setting the 'sudoers_debug' parameter to a value of 1 shows moderate
203debugging.  A value of 2 shows the results of the matches themselves.  Make
204sure to set the value back to zero so that other users don't get confused by
205the debugging messages.
206