LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-27-2011, 02:18 PM   #1
KillaSmooth
LQ Newbie
 
Registered: Apr 2011
Posts: 22

Rep: Reputation: 1
permissions on autofs directory


Hey all,
I'm setting up an automatic mount point on one of my servers. However, for this file I only want certain people (permissions) to access it once it is mounted. I'm figuring I need to place this either on an ACL (via setfacl) or by configuring this in my mount point config file (auto.misc) . Has anyone done this before, restrict use of an auto mounted directory?

for my auto.master file I have:

$ cat /etc/auto.master
/pLogs /etc/auto.pLogs

$ cat /etc/auto.pLogs
asample -fstype=nfs,ro,noserverino,gid=505,soft,credentials=/etc/logs.cred

In the above, I'm trying to set the group ownership/permissions to group 505. This is not working however. Does anyone know what I maybe doing wrong?

ps. this isn't a big deal, just wondering if its possible
 
Old 05-27-2011, 06:44 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Reply

Hi there,

Yes it is possible. What you need to do is instead of using the default /misc directory use a collaboration directory or what we called a share directory. Here are the steps that you can use:

1. Create a group using groupadd. Ex: groupadd shared
2. Add the user to that group using the following command: usermod -G group_name username
3. Change the ownership of that directory using following command: chown nobody.shared /directory_path
4. Change the permission on the directory using chmod as follows: chmod 2770 /directory_path
5. Create a new file in /etc or any location say, I am creating file in /etc for example: vi /etc/auto.restricted
6. Put the following in /etc/auto.restricted file: mountpointname <put a tab> -fstype=ext3 <put a tab> Directory_location_on_the_remote_server. So this can come down as follow:

Code:
shared              -fstype=ext3,rw                 myserver.test.com:/home/shared
7. Edit auto.master file and add the following line just below /misc line: /location_on_local_server_where_to_mount <put a tab> /etc/auto.restricted --timeout=60. So it will come down as follows:

Code:
/tmp/shared                  /etc/auto.restricted            --timeout=60
Here we are instructing the automounter that directory via autofs will mount under the shared directory and use /etc/auto.restricted to get the mounting information.

I hope this helps
 
Old 05-31-2011, 07:36 AM   #3
KillaSmooth
LQ Newbie
 
Registered: Apr 2011
Posts: 22

Original Poster
Rep: Reputation: 1
T3RM1NVTOR- That worked perfectly!
I didn't need to change my auto.pLogs file because all my mounting info was already written in (above).
I didn't realize that by just changing the owner's permission (chown); in particular the GROUP, that I could restrict access w/o using ACL.

Thanks again!
 
Old 05-31-2011, 12:27 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Great!!! Good to hear that. Am glad that you found it helpful.

Please mark the thread as solved.
 
  


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
Question about autofs and the mount point directory jamida Linux - Networking 4 12-24-2009 01:31 PM
Autofs fails to mount home directory Neruocomp Solaris / OpenSolaris 0 05-20-2009 01:58 PM
autofs, konqueror and a .directory file arizonagroovejet Linux - General 0 06-10-2008 03:43 PM
autofs works, but doesnt show automounted directory nef Linux - Software 1 03-02-2005 07:12 PM
Mounting floppies with autofs and reasonable permissions bobthebat Linux - General 3 11-26-2001 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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