Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have setup an 389 directory server on Centos 6. User authentication works fine, however, I have to create individual users on each client machine after creating the user at the directory server.

The the module seems to create home directories in case the user is already present in the local system.

share|improve this question
up vote 3 down vote accepted

Finally I got the answer and solution. It is pretty simple. Similar discussion has already been done long back.

How to allow a certain group of useres to only login via LDAP while others can use LDAP or local login?

So here is snippet of my system-auth file for anyone looking for same.

account     sufficient
account     sufficient

session     optional skel=/etc/skel umask=022
share|improve this answer

Configure your /etc/pam.d/system-auth & /etc/pam.d/password-auth like below.

session     optional revoke
session     required
session     optional
session     [success=1 default=ignore] service in crond quiet use_uid
session     required
session     optional

For a home directory to be created automatically when a user logs in, You can use either the pam_oddjob_mkhomedir module or the pam_mkhomedir module. Because oddjob requires fewer permissions and works well with SELinux, you should always use pam_oddjob_mkhomedir module. If that module is not installed, then it falls back to the pam_mkhomedir module.

If you are trying to login using ssh, you have to do below as well.

Modify /etc/ssh/sshd_config to contain

"UsePam yes"

# service sshd restart
# service oddjobd restart
share|improve this answer

Your Answer


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.