Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > Configuration > Issue <<  257 of 606 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 9091
Last update: 07-19-07
Issue:
Why is the pam_mkhomedir, which is used to create home directories automatically, no longer working?
Resolution:

Release found:
Red Hat Enterprise Linux 4
Red Hat Enterprise Linux 5

Solution:
The service pam_mkhomedir relies on the program doing the authentication (su, or login for example), to have enough permissions to create the home directories. This is not the case, as most authentication applications drops the permissions to avoid security problems.

To create home directories on-the-fly, use pam_oddjob_mkhomedir instead. In this case, the directory creation will be handled by a D-Bus service running as root instead.

To put it in place follow the steps below:
  • Update the oddjob package:
    up2date -i oddjob
    
  • Restart D-Bus, this might require to restart some services that rely on D-Bus, such as hal:
    #service messagebus restart 
    
  • Start the oddjob service:
    #service oddjobd restart 
    
  • Make sure it runs on startup:
    #chkconfig oddjobd on 
    
  • Modify the PAM configuration to use pam_oddjob_mkhomedir. For example, add this line at the bottom of /etc/pam.d/system-auth:
    session required pam_oddjob_mkhomedir.so
    
  • In the configuration file oddjobd.conf, put the following two options:
    skel=/etc/skel/
    umask=0022
    

Now to test if it is working, try to log in as a user that does not have a home directory.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > Configuration > Issue <<   257  of  606  >>