Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We have a LDAP server and lots working servers. Our user's info are in LDAP http://fclose.com/b/281/ . But sudoers list is stored in /etc/sudoers. Now the question is, how to store sudoers list in LDAP so that there is a center control of it?

We are using Fedora 12 on both LDAP server and working servers.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Follow the official instructions from README.LDAP, and the sudoers.ldap manual page.

  1. Make sure sudo is built with LDAP support.
  2. Update the LDAP schema.
  3. Import sudoers file into LDAP.
  4. Configure the sudoers service in nsswitch.conf.
share|improve this answer
add comment

If you do this, make sure you have a fallback config in your files in case LDAP goes down. It would suck if you have sudo set up for sysadmin use, and you can't use it when it's most needed because the network is down.

share|improve this answer
add comment

Add sudo entry like below

dn: ou=sudoers,ou=people,dc=example,dc=com
ou: sudoers
objectClass: top
objectClass: organizationalUnit

dn: cn=sudogroup,ou=sudoers,ou=people,dc=example,dc=com
objectClass: top
objectClass: sudoRole
cn: sudogroup
sudoUser: thomas
sudoHost: ALL
sudoRunAs: ALL
sudoCommand: ALL

Add sudoers_base in ldap.conf for client.

sudoers_base ou=sudoers,ou=people,dc=example,dc=com

& Edit /etc/nsswitch.conf like below

sudoers : files ldap
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.