I have successfully configured sssd and can ssh into a system with AD credentials what I am missing is the creation of a home directory and bash set as the shell.

My assumption is that if I log on to a system that does not already have a local linux account but which does have a valid AD account that a home directory is created the first time that user logs in and the appropriate shells is set as defined in /etc/sssd/sssd.conf:

override_homedir = /home/%u
default_shell = /bin/bash

I have also run

authconfig --enablesssd --enablesssdauth --enablemkhomedir --update

What am I missing or am I making an incorrect assumption about my existing configuration?

I want to avoid using the deprecated Identity Management for Unix feature of Windows.

  • What operating system distribution and version? – ewwhite Mar 18 '15 at 4:06
  • I am using CentOS 6.6 and Windows Server 2008 R2 – grahamjgreen Mar 18 '15 at 4:29

This issue was solved by moving the entries

override_homedir = /home/%u
default_shell = /bin/bash

from the [sssd] section of sssd.conf to [domain/lab.local]

  • Ah, that's expected, then. We really should implement the config validator one of these days. The override_homedir and default_shell options are in effect only in the [nss] and [domain] sections, with domain taking precedence of nss options. – jhrozek Mar 24 '15 at 9:01
  • Can you check this as the accepted answer? The RHEL AD Integration Guide has the entries you mentioned in the wrong place and your answer solved my problem. Many thanks. – user2150250 Aug 23 '16 at 15:21

There are two parts of the equation. One is in SSSD and the Name Service Switch interface in particular. That part reports what the home directory is on the system and you can test it with "getent passwd $username". As long as that command gives you accurate answers, then SSSD is working as it should.

The other part is creating the home directories actually. I would recommend to use oddjob and pam_oddjob_mkhomedir there over old pam_mkhomedir. In my experience, it plays better with SELinux.

Look into /var/log/secure for error messages from the PAM modules..

  • getent returns expected results I have oddjob is installed per the RHEL AD integration documentation. – grahamjgreen Mar 18 '15 at 14:01

Please see this post first: Common wisdom about Active Directory authentication for Linux Servers?

For RHEL/CentOS 6.x systems, I do:

  • Authconfig with the right initial SSSD settings.
  • Modify sssd.conf to taste.
  • Modify and configure oddjobd.

For authconfig, something like:

authconfig --enablesssd --ldapserver=ldap://dc1.ad.blahblah.com --ldapbasedn="dc=ad,dc=blahblah,dc=com" --enablerfc2307bis --enablesssdauth --krb5kdc=dc1.ad.blahblah.com --krb5realm=AD.BLAHBLAH.COM --disableforcelegacy --enablelocauthorize --enablemkhomedir --updateall

  • My simple sssd.conf would look like this: http://pastebin.com/Aa2XsYhh - Restart the sssd service after modifying the configuration.

  • I then install oddjob-mkhomedir with: yum install oddjob-mkhomedir- You can tune home directory permissions to taste in /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf

  • Make sure the sssd and oddjob services are set to start on boot.

That should be all that's needed.


It works for me on CentOS 7 when i login via SSHD. The location where the home directory created is the "session" management group that's part of PAM.

From the pam(8) manpage:

    session - this group of tasks cover things that should be done prior to a service being given and after it is
   withdrawn. Such tasks include the maintenance of audit trails and the mounting of the user's home directory.
   The session management group is important as it provides both an opening and closing hook for modules to
   affect the services available to a user.

In /etc/pam.d/password-auth you will find this line: session optional pam_oddjob_mkhomedir.so umask=0077

which takes care of home directory creation.

Make sure you have installed and enabled the package oddjob-mkhomedir.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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