Server IP : 103.119.228.120 / Your IP : 18.225.56.79 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/sudo-1.8.23/ |
Upload File : |
This file explains how to build the optional LDAP functionality of SUDO to store /etc/sudoers information. This feature is distinct from LDAP passwords. For general sudo LDAP configuration details, see the sudoers.ldap manual that comes with the sudo distribution. A pre-formatted version of the manual may be found in the sudoers.ldap.cat file. The sudo binary compiled with LDAP support should be totally backward compatible and be syntactically and source code equivalent to its non LDAP-enabled build. LDAP philosophy =============== As times change and servers become cheap, an enterprise can easily have 500+ UNIX servers. Using LDAP to synchronize Users, Groups, Hosts, Mounts, and others across an enterprise can greatly reduce the administrative overhead. In the past, sudo has used a single local configuration file, /etc/sudoers. While the same sudoers file can be shared among machines, no built-in mechanism exists to distribute it. Some have attempted to workaround this by synchronizing changes via CVS/RSYNC/RDIST/RCP/SCP and even NFS. By using LDAP for sudoers we gain a centrally administered, globally available configuration source for sudo. For information on OpenLDAP, please see http://www.openldap.org/. Definitions =========== Many times the word 'Directory' is used in the document to refer to the LDAP server, structure and contents. Many times 'options' are used in this document to refer to sudoer 'defaults'. They are one and the same. Build instructions ================== The simplest way to build sudo with LDAP support is to include the '--with-ldap' option. $ ./configure --with-ldap If your ldap libraries and headers are in a non-standard place, you will need to specify them at configure time. E.g. $ ./configure --with-ldap=/usr/local/ldapsdk Sudo is developed using OpenLDAP but Netscape-based LDAP libraries (such as those present in Solaris) are also known to work. Your mileage may vary. Please let the sudo workers mailing list <sudo-workers@sudo.ws> know if special configuration was required to build an LDAP-enabled sudo so we can improve sudo. Schema Changes ============== You must add the appropriate schema to your LDAP server before it can store sudoers content. For OpenLDAP, copy the file schema.OpenLDAP to the schema directory (e.g. /etc/openldap/schema). You must then edit your slapd.conf and add an include line the new schema, e.g. # Sudo LDAP schema include /etc/openldap/schema/sudo.schema In order for sudoRole LDAP queries to be efficient, the server must index the attribute 'sudoUser', e.g. # Indices to maintain index sudoUser eq After making the changes to slapd.conf, restart slapd. For Netscape-derived LDAP servers such as SunONE, iPlanet or Fedora Directory, copy the schema.iPlanet file to the schema directory with the name 99sudo.ldif. On Solaris, schemas are stored in /var/Sun/mps/slapd-`hostname`/config/schema/. For Fedora Directory Server, they are stored in /etc/dirsrv/schema/. After copying the schema file to the appropriate directory, restart the LDAP server. Finally, using an LDAP browser/editor, enable indexing by editing the client profile to provide a Service Search Descriptor (SSD) for sudoers, replacing example.com with your domain: serviceSearchDescriptor: sudoers: ou=sudoers,dc=example,dc=com If using an Active Directory server, copy schema.ActiveDirectory to your Windows domain controller and run the following command: ldifde -i -f schema.ActiveDirectory -c dc=X dc=example,dc=com Importing /etc/sudoers into LDAP ================================ Importing sudoers is a two-step process. Step 1: Ask your LDAP Administrator where to create the ou=SUDOers container. For instance, if using OpenLDAP: dn: ou=SUDOers,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: SUDOers (An example location is shown below). Then use the cvtsudoers utility to convert your sudoers file into LDIF format. # SUDOERS_BASE=ou=SUDOers,dc=example,dc=com # export SUDOERS_BASE # cvtsudoers -f ldif -o /tmp/sudoers.ldif /etc/sudoers Step 2: Import into your directory server. The following example is for OpenLDAP. If you are using another directory, provide the LDIF file to your LDAP Administrator. # ldapadd -f /tmp/sudoers.ldif -h ldapserver \ -D cn=Manager,dc=example,dc=com -W -x Step 3: Verify the sudoers LDAP data: # ldapsearch -b "$SUDOERS_BASE" -D cn=Manager,dc=example,dc=com -W -x Managing LDAP entries ===================== Doing a one-time bulk load of your ldap entries is fine. However what if you need to make minor changes on a daily basis? It doesn't make sense to delete and re-add objects. (You can, but this is tedious). I recommend using any of the following LDAP browsers to administer your SUDOers. * GQ - The gentleman's LDAP client - Open Source - I use this a lot on Linux and since it is Schema aware, I don't need to create a sudoRole template. http://sourceforge.net/projects/gqclient/ * phpQLAdmin - Open Source - phpQLAdmin is an administration tool, originally for QmailLDAP, that supports editing sudoRole objects in version 2.3.2 and higher. http://phpqladmin.com/ * LDAP Browser/Editor - by Jarek Gawor - I use this a lot on Windows and Solaris. It runs anywhere in a Java Virtual Machine including web pages. You have to make a template from an existing sudoRole entry. http://www.iit.edu/~gawojar/ldap http://www.mcs.anl.gov/~gawor/ldap http://ldapmanager.com * Apache Directory Studio - Open Source - an Eclipse-based LDAP development platform. Includes an LDAP browser, and LDIF editor, a schema editor and more. http://directory.apache.org/studio There are dozens of others, some Open Source, some free, some not. Configure your /etc/sudo-ldap.conf and /etc/nsswitch.conf ==================================================== The /etc/sudo-ldap.conf file is meant to be shared between sudo, pam_ldap, nss_ldap and other ldap applications and modules. IBM Secureway unfortunately uses the same file name but has a different syntax. If you need to change where this file is stored, re-run configure with the --with-ldap-conf-file=PATH option. See the "Configuring ldap.conf" section in the sudoers.ldap manual for a list of supported ldap.conf parameters and an example ldap.conf Make sure you sudoers_base matches the location you specified when you imported the sudoers ldif data. After configuring /etc/sudo-ldap.conf, you must add a line in /etc/nsswitch.conf to tell sudo to look in LDAP for sudoers. See the "Configuring nsswitch.conf" section in the sudoers.ldap manual for details. Note that sudo will use /etc/nsswitch.conf even if the underlying operating system does not support it. To disable nsswitch support, run configure with the --with-nsswitch=no option. This will cause sudo to consult LDAP first and /etc/sudoers second, unless the ignore_sudoers_file flag is set in the global LDAP options. Debugging your LDAP configuration ================================= Enable debugging if you believe sudo is not parsing LDAP the way you think it should. Setting the 'sudoers_debug' parameter to a value of 1 shows moderate debugging. A value of 2 shows the results of the matches themselves. Make sure to set the value back to zero so that other users don't get confused by the debugging messages.