Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-06-2007, 11:59 AM   #1
LQ Newbie
Registered: Jan 2007
Distribution: Ubuntu, Kubuntu
Posts: 5

Rep: Reputation: 0
Change Default Home Directory with LDAP and Automount


I have a number of machines that are set up with LDAP Authentication. The LDAP also stores the path to the user's home directory. That user home directory is actually on an NFS server. So the path stored in LDAP for user bubba is: /homedirs/bubba. I use automount to mount each user's home when they log in. That part works great. So the user logs in via LDAP, gets their NFS home mounted, and all is good.

However, we have a second set of machines that need to be set up in the same way. This second set of machines will need a different set of preferences. IE - must use a different home directory. This will use the same NFS server space for the home dir. I tried to just change the mount point via automount to /homedirs/bubba/unix01. But, couldnt log in, because unix01 dir did not exist. This is where I am having a heck of a time. Ultimately, I'd like to have a different home dir for each set of machines like: /homedirs/bubba/unix01, /homedirs/bubba/unix02. And that unixXX directory be made if it doesnt exist, upon the user logging in.

I could just do a bash script somewhere that would "If not exist /homedirs/$USER/unix01, mkdir /homedirs/$USER/unix01". But not sure where to put it. Anything in .profile, .bashrc, would be too late.

The options of manipulating the LDAP server itself, or of just creating those dirs on the NFS server are out. (There are 10s of thousands of users.. and the NFS server is controlled by another entity)

Any thoughts on this would be much appreciated. Or perhaps a different take on how to solve this. My mind is spinning!

(Hope I explained this clearly enough)
Old 06-13-2007, 10:34 PM   #2
LQ Newbie
Registered: Jun 2007
Location: Jakarta, Indonesia
Distribution: debian, kubuntu
Posts: 9

Rep: Reputation: 0
halo greslore, you say that you are succesfull to mount each user's home directory when they log in, do you configure on the client side or just let ldap do automatically for you? i'm having a trouble using automount with ldap now, could you kindly tell me how to configure it?
Old 06-15-2007, 04:28 PM   #3
LQ Newbie
Registered: Jan 2007
Distribution: Ubuntu, Kubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Hi vjhunts.

To get autofs working, here is what I did:

1) apt-get install autofs

2) vi /etc/auto.master

My auto.master file:
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#/misc /etc/auto.misc --timeout=60
#/net /etc/
/auto /etc/ --timeout=60
/homedirs /etc/auto.homedirs --timeout=60

3) vi /etc/auto.homedirs

My auto.homedirs file:
( There is a tab between the * and the servername, and the '&' above tells autofs to use the currently logged in user as part of pathname )

And this enabled me to use autofs. No matter which machine a user logs into, they will have the same network home. Keep in mind that this will use the home that you have set up in your LDAP setting for the user logging in. In my case the home on the LDAP server is set to /homedirs/username

Oh, and this is using Ubuntu linux 6.06 by the way. So you may need to install autofs via your distro specifics.

Last edited by greslore; 06-15-2007 at 04:32 PM.
Old 06-23-2009, 04:32 PM   #4
LQ Newbie
Registered: Dec 2007
Location: Washington, DC
Distribution: Fedora 10, openSUSE 10.2/10.3, CentOS 5.4, Ubuntu 8.10 LTS
Posts: 4
Blog Entries: 2

Rep: Reputation: 0
Did you ever resolve this issue? I would love to hear how!


autofs, automount, home, ldap

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
automount home directories with information from Active Directory (or NIS) alex r Linux - Software 5 08-30-2006 11:05 AM
Home Directory Default Rights Cottsay Linux - General 2 08-29-2005 02:44 PM
xterm default home directory Fritz_Monroe Linux - Newbie 2 08-05-2005 02:33 PM
default home directory kiley_rodgers Slackware 8 08-04-2003 08:17 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:41 PM.

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