LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-25-2010, 05:58 PM   #1
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
autofs under /


I cannot remember how I did this back in the day, and hoping you guys can help.

The below works fine when I do a standard NFS mount:
Code:
mount server:/storage/admins /admins
I want to do an automount version of it:

My /etc/auto.master file:
Code:
/admins /etc/auto.admins
My /etc/auto.admins file (in psuedo configuration of what I want)
Code:
. -fstype=nfs,rw,hard,intr server:/storage/admins #just let me put it under /admins!!!!
In other words, I want server:/storage/admins to be automounted to /admins. For some reason, autofs requires me to create an automounted folder, but I do not want that. For example,
Code:
/admins/Why-do-I-need-this-additional-folder?!???
What is the correct way to do this? I know I can create a symlink to look like it, but, I sort of remember doing it the real way.

Last edited by Micro420; 02-25-2010 at 06:11 PM.
 
Old 02-25-2010, 07:42 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,489

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
seeing as mounting to / is a VERY bad idea
BUT mounting to /mnt/File-Name ( or /admins/Why-do-I-need-this-additional-folder?!???)
is because you do not want to give ROOT command to ANYbody and anything using the mount point
that is just asking EVERY bad guy on the net to PLEASE HACK ME - here i will make it VERY easy - you will already have ROOT privilege!!!
 
Old 02-25-2010, 10:16 PM   #3
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Original Poster
Rep: Reputation: 45
I guess I'll just have to do a symbolic link.
Code:
ln -s /mnt/admins /admins

Last edited by Micro420; 02-25-2010 at 10:18 PM.
 
Old 02-25-2010, 10:36 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,782

Rep: Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538
You're looking for the

* blahblah srv:/dir/&

syntax
eg

* -fstype=nfs,rw,hard,intr server:/storage/admins/&
 
Old 02-26-2010, 10:38 AM   #5
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by chrism01 View Post
You're looking for the

* blahblah srv:/dir/&

syntax
eg

* -fstype=nfs,rw,hard,intr server:/storage/admins/&
THANK YOU! That worked perfectly as I wanted. I had done this before, but forgot how to do this. THANK YOU!

Case closed.

Last edited by Micro420; 02-26-2010 at 10:39 AM.
 
Old 03-01-2010, 02:26 PM   #6
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Original Poster
Rep: Reputation: 45
Another question. How do I get /admins to always be visible without doing a hard mount? Is this possible to do with autoFS and automount?

Last edited by Micro420; 03-01-2010 at 02:42 PM.
 
Old 03-01-2010, 09:43 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,782

Rep: Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538Reputation: 2538
What do you mean by hard mount? If the src is exported then autofs should find it when you try to use it.
You may want to add

/net -hosts

in /etc/auto.master to auto (lazy mount) browse all nfs exports available.
 
Old 03-02-2010, 12:41 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,489

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
but my question is WHY mount a folder directly to /
and WHY do you want to give EVERYONE how has access to the partition on that server root permission and privilege and SELinux root context .


The "crackers" just love this as much as having the system
password = password
user = user


but this is your system

WE ( the rest of the net)JUST HAVE TO LIVE ( or die) with it.
 
Old 03-04-2010, 02:23 PM   #9
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by chrism01 View Post
What do you mean by hard mount? If the src is exported then autofs should find it when you try to use it.
You may want to add

/net -hosts

in /etc/auto.master to auto (lazy mount) browse all nfs exports available.
What I mean is that currently if you do
Code:
ls /
/admins does not show up. It's only until you do
Code:
ls /admins
Then /admins shows up. In other words, a user would not know that /admins existed because they won't see it until they call it. Is there a way to have /admins always be visible, but not constantly being mounted? I realize I could do the "hard" mount where it will constantly be there:
Code:
mount -t nfs server:/storage/admins /admins
I prefer to have it actually mounted only when it is called. I understand that the old school AMD (automounter daemon) had this ability to create maps that weren't actually mounted until they were called.

Quote:
Originally Posted by John VV View Post
but my question is WHY mount a folder directly to /
Because mounting to /admins or /users is a lot cleaner than /misc/users or /misc/admins

Quote:
Originally Posted by John VV View Post
and WHY do you want to give EVERYONE how has access to the partition on that server root permission and privilege and SELinux root context .
Can you give me a specific example of how this is a security risk and how you can prove it? Please clarify. I don't see the /admins folder inheriting root permissions.

Quote:
Originally Posted by John VV View Post
The "crackers" just love this as much as having the system
password = password
user = user


but this is your system

WE ( the rest of the net)JUST HAVE TO LIVE ( or die) with it.
I appreciate your concern for the internet.

Last edited by Micro420; 03-04-2010 at 02:40 PM.
 
Old 03-04-2010, 04:00 PM   #10
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
I solved that problem about visibility of the imported/exported forlders. I set autofs to create folders in some folder like "/autofsfolders/<server_name>/<folders>" and then create soft link in the desired spot.

In your case, I would set autofs to create admins in /autofsfolders/server/admins, and then create softlink to root folder ( /admins ). So link will be visible and available from file managers.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
autofs sl4ckw4re Slackware 1 09-18-2006 12:51 PM
autofs kemkem42 Linux - Software 1 09-22-2005 01:22 PM
autofs fitteschleiker Slackware 2 06-28-2005 04:17 PM
Using Autofs guygriffiths Linux - Software 1 09-17-2003 10:31 AM
Autofs...help please yourcompadre Linux - Networking 0 06-03-2003 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:50 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