LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   autofs under / (https://www.linuxquestions.org/questions/red-hat-31/autofs-under-791602/)

Micro420 02-25-2010 05:58 PM

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.

John VV 02-25-2010 07:42 PM

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!!!

Micro420 02-25-2010 10:16 PM

I guess I'll just have to do a symbolic link.
Code:

ln -s /mnt/admins /admins

chrism01 02-25-2010 10:36 PM

You're looking for the

* blahblah srv:/dir/&

syntax
eg

* -fstype=nfs,rw,hard,intr server:/storage/admins/&

Micro420 02-26-2010 10:38 AM

Quote:

Originally Posted by chrism01 (Post 3877223)
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.

Micro420 03-01-2010 02:26 PM

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?

chrism01 03-01-2010 09:43 PM

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.

John VV 03-02-2010 12:41 AM

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.

Micro420 03-04-2010 02:23 PM

Quote:

Originally Posted by chrism01 (Post 3881852)
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 (Post 3881998)
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 (Post 3881998)
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 (Post 3881998)
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.

DrLove73 03-04-2010 04:00 PM

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.


All times are GMT -5. The time now is 05:30 AM.