LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2016, 08:40 AM   #1
and1_hotsauce
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Rep: Reputation: Disabled
automount home directory for a specific user


Assume I have a user called Bob who is authenticated through LDAP. I want to mount Bob's home directory under /ldaphome/bob

How do I do this? I've seen it done like the following:

Code:
vim /etc/auto.master
/ldaphome/bob /etc/auto.ldaphome
Code:
vim /etc/auto.ldaphome
* -rw domain.example.com:/ldaphome/bob
What does that first place signify? I know the star means "anything", but what else can I put there?

In the auto.misc file, they have some keywords like soft, intr and sync. What do these words mean?


------------------------
also is my understanding correct:
Code:
vim /etc/auto.master
/ldaphome/bob /etc/auto.ldaphome
Here we are basically setting up a monitor. If bob types cd /ldaphome/bob then autofs searches the auto.master file for an entry. Then, the next 'map' is searched (auto.ldaphome). In this file, we have the location of bob's remote home directory that is to be mounted.

Last edited by and1_hotsauce; 04-24-2016 at 08:58 AM.
 
Old 04-25-2016, 02:22 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
man 5 auto.master
 
Old 04-25-2016, 11:23 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,790

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
The idea with automounter is to have
Code:
vim /etc/auto.master
/ldaphome /etc/auto.ldaphome
and
Code:
vim /etc/auto.ldaphome
* -rw domain.example.com:/ldaphome/&
and it will mount bob and other users automatically in /ldaphome
--
If you want only bob then you can use
Code:
vim /etc/auto.ldaphome
bob -rw domain.example.com:/ldaphome/bob

Last edited by MadeInGermany; 04-25-2016 at 11:28 AM.
 
Old 05-16-2016, 12:37 AM   #4
Jake_99
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: Disabled
Why can't you do something like:

vim /etc/auto.master.d/ldap.autofs

/home/ldap /etc/auto.ldap


vim /etc/auto.ldap
* -rw,sync domain.example.com:/home/&

...as your indirect master? I tried but can't get it to work...if I replace /home/ldap with a first level directory (/ldaphome or /home) it works...

With /ldaphome option, you have to remember to set SELinux context since it has the default context of the directory creator - don't you have to match context of /home correct?

With /home, you end up losing access to local directories since ldap is now mounting on top of the local directory structure...I'd like to be able to access both in same structure.

Last edited by Jake_99; 05-16-2016 at 01:15 AM.
 
  


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
[SOLVED] How to automount secondary disk inside ecryptfs home directory? coralfang Linux - Software 1 06-19-2014 06:13 PM
[SOLVED] Automount other harddrives while encrypted home directory sadarax Linux - Security 5 11-06-2011 07:59 PM
Help! Adding user with a specific home directory that already exists dwoelper Linux - Newbie 7 04-09-2010 08:52 AM
Change Default Home Directory with LDAP and Automount greslore Linux - General 3 06-23-2009 03:32 PM
automount specific user's file on an NFS server cememet Linux - Networking 4 05-16-2007 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 PM.

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