Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm configuring several computers in a lab to operate with the same login credentials shared between the computers, but without sharing the home directories. I'm considering using NIS for sharing the login credentials. How can I configure NIS to automatically create a new user's home directory on each machine, without having to manually login to each machine myself, and without having to share the home directories by NFS?

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

NIS is a way to obtain data (authentication data, path to home directory, …) about users (and other stuff). Doing things (e.g. creating a directory) is not its job. So I think you're looking in the wrong place.

Most unices use PAM to manage logins (not just authentication but also credential management, account management and most relevantly session management). The Linux implementation (and others) includes a module called pam_mkhomedir which does exactly what you want. Put this line in /etc/pam.d/* for each service that allows local users to log in (or in /etc/pam.d/common-session if you have that):

session    required    pam_mkhomedir.so skel=/etc/skel/
share|improve this answer
add comment

I had the same problem, and noticed that the real problem is that accounting/session is failing because the radius user doesn't have an entry in /etc/passwd. I have solved the problem by using pam_script to execute adduser before entering the gdm session.

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.