LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2005, 08:10 AM   #1
dumbsheep
Member
 
Registered: Jan 2005
Location: USA
Distribution: Red Hat, CentOS, Fedora, Suse
Posts: 54

Rep: Reputation: 15
Post Home Directory Script


All,

I recently installed K12LTSP on my network and now have it authenticating users against a W2K3 ADS via winbind. I am running into a problem however.

I have a fairly large network with quite a few users and would like the ability to have a script get the AD user information and create home folders for me so that I don't have to create each one individually. I checked out the file 'README.pam_mkhomedir' located in /usr/share/doc/pam and was unable to get the 'session required pam_mkhomedir.so skel=/etc/skel/ umask=0022' add on line to work in my /etc/pam.d/login file.

Has anyone successfully created a script that can grab active directory user information and automatically create home folders for them on Linux? If not, can someone point me in the right direction? Thanks in advance.

-dumbsheep
 
Old 10-27-2005, 03:18 PM   #2
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Yes, I've done this. I found that pam_mkhomedir didn't seem to actually work in practice. The first time that the user logged in the login could fail since the home directory and the files didn't exist for the login to complete.

In the end I simply wrote a Perl script and put it in cron to run every hour. It ran wbinfo -u to fetch a list of users, and compared this with a list of the directories under /home. If no home directory existed for a username it created one, copied in the contents of a template directory, and reset the permissions on the new directory.
 
Old 10-28-2005, 09:50 PM   #3
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
http://www.linuxquestions.org/questi...hreadid=376893
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
c++ home directory bendeco13 Programming 2 11-04-2005 05:27 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
home directory under a home directory GEEXTER Linux - General 4 04-03-2003 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration