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?
Using NIS without NFS
directoryloginnisusers
Best Answer
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):