LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-07-2003, 01:05 PM   #1
stefanlasiewski
Member
 
Registered: Aug 2003
Location: Berkeley, California, USA
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92

Rep: Reputation: 16
Proper umask settings for /etc/fstab?


Hey all,

Need some help mounting a Windows/fat32 partition properly.

Currently, my /etc/fstab lhas the following listing:

/dev/hda1 /mnt/windows vfat defaults,user,uid=windows,gid=windows,umask=007 0 0

This gives the following permissions to all files & directories:

drwxrwx--- 6 windows windows 4096 May 11 11:58 /mnt/windows/Documents and Settings
-rwxrwx--- 1 windows windows 186 Dec 27 2002 /mnt/windows/autoexec.bat

I think it's a bad idea for all files to be automatically listed as executable. Files shouldn't be executable unless absolutely necessary.

What I want is for user 'windows' and members of group 'windows' to be able to:
- Read, write & access directories. Unix directories need to be executable if you want access, correct?
- Read, write but not execute normal files

I'm hoping for somethign like this with a single umask:

drwxrwx--- 6 windows windows 4096 May 11 11:58 /mnt/windows/Documents and Settings
-rw-rw---- 1 windows windows 186 Dec 27 2002 /mnt/windows/autoexec.bat


Is this possible?

Any help is appreciated.

-= Stefan
 
Old 08-07-2003, 02:23 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
In the options, when you add user it also implies noexec.
noexec will not allow any binaries on the mounted file system to be executed.

Take a look at the mount MAN page for more information concerning the available options.

Last edited by Mathieu; 08-07-2003 at 02:44 PM.
 
Old 08-07-2003, 02:35 PM   #3
stefanlasiewski
Member
 
Registered: Aug 2003
Location: Berkeley, California, USA
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92

Original Poster
Rep: Reputation: 16
Ah thanks, so the executable bit is ignored with the user or noexec options.

Good to know. I was just being paranoid.

-= Stefan
 
Old 08-07-2003, 03:40 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,541
Blog Entries: 54

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
In the options, when you add user it also implies noexec.
noexec will not allow any binaries on the mounted file system to be executed.

Try "/lib/ld-linux.so.2 </mountdir/partition/bindir/binary>" to see if that statement is true. If not, and you need to disable execs outside people's $PATH properly, head over to grsecurity.net and patch your kernel. The TPE settings are what you're looking for.
 
Old 08-07-2003, 07:01 PM   #5
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Defaults gives :

rw, suid, dev, exec, auto, nouser, and async

umask=117

will give you

-rw-rw----

Last edited by Skyline; 08-07-2003 at 07:02 PM.
 
Old 08-07-2003, 08:48 PM   #6
stefanlasiewski
Member
 
Registered: Aug 2003
Location: Berkeley, California, USA
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Posts: 92

Original Poster
Rep: Reputation: 16
<i>
umask=117

will give you

-rw-rw----
</i>

That is fine for files, but it renders any directory inaccessable, because the executable bit is not set.
 
Old 06-05-2009, 07:27 PM   #7
ForYouAndI.com
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 82

Rep: Reputation: 15
This works for me:

defaults,noexec,dmask=007,fmask=117,uid=user,gid=user
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab, umask and users permissions foucault Linux - Security 3 11-03-2005 02:13 AM
Umask - Settings XaViaR Linux - General 2 09-28-2005 07:24 PM
Getting my fstab to give proper permissions Esmo2000 Linux - Newbie 3 11-10-2004 01:21 PM
How do I set up proper drive permissions (fstab reamins static despite all mounts) Lechium Linux - Hardware 9 07-03-2004 10:33 AM
mount network drive fstab/umask? J.Q. Monkey Linux - Newbie 3 02-24-2004 01:49 PM


All times are GMT -5. The time now is 04:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration