LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-28-2009, 01:02 PM   #1
mawkernewek
Member
 
Registered: Nov 2007
Posts: 36

Rep: Reputation: 15
Setting permissions for individual folders on external drive


I would like to set my external drive up so that a certain folder is available to all users, but another folder is available only to a single user.

the fstab line for the drive is currently

/dev/disk/by-id/usb-ST932032_0AS_000000000000-0:0-part1 /media/Iomega\040HDD ntfs-3g user,uid=dlrt2,gid=users,locale=en_GB.UTF-8 0 0

which mounts the drive with all files and folders having rwxrwxrwx permissions.

I have tried changing the permissions or ownership of individual folders but it doesn't work. It does not give any error but the permissions are always the same as before.

I am using OpenSUSE 11.1

Last edited by mawkernewek; 07-28-2009 at 01:08 PM.
 
Old 07-28-2009, 01:12 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
The permissions don't change because NTFS (and FAT as well) does not support unix-style ownership or permissions. These can only be simulated with options like uid, gid, and umask in the mount command. These options apply to the mounted filesystem as a whole, so I don't think it's possible to give separate permissions to subdirectories on NTFS or FAT. But you might check the ntfs-3g man page to be sure.

You should consider reformatting the drive to ext3 or another posix-supporting filesystem, if possible.
 
Old 07-28-2009, 03:05 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I agree that ntfs is a poor file system choice for windows, unless your intention is to physically share the drive with a windows machine. But you can select the permissions of a mounted ntfs filesystem using the "uid", "gid", "fmask" and "umask" mount options. Be sure to include the "x" permission of directories to allow them to be entered. I would clear the "x" permission bit of all files. Also consider "noexec,nosuid" for all mass storage drives regardless of the filesystem. Keep in mind that these permissions are for the entire filesystem. So you may need to partition and reformat the drive to do this and still use ntfs.

If you are sharing this drive, using samba, to people on the network, then you can use samba's controls on which users may access which shares. Here it is the samba permissions denying access. But a user needs permission to access the filesystem before samba can grant permission. Samba can add further restrictions.

Please see the man pages for mount and mount.ntfs for more options.

Last edited by jschiwal; 07-28-2009 at 03:11 PM.
 
  


Reply

Tags
drive, external, permissions



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
External Hard Drive Permissions Eric952x Linux - General 2 11-24-2007 08:26 PM
Virtual Desktops with individual icons and folders dante65 Linux - Desktop 4 06-27-2007 12:26 PM
external hard drive permissions djljjm Linux - Hardware 12 04-06-2005 01:23 PM
Setting permissions on an external USB hard drive so that all users can read from it? Pi Man Linux - Hardware 2 09-07-2004 09:50 PM
Mounting Windows NT shared folders for individual users Jake_da_Snake Linux - Networking 6 02-28-2004 02:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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