6

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?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Ken Bloom
  • 400
  • 1
  • 9

2 Answers2

10

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/
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
1

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.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Lorenzo
  • 11
  • 1