Setting permissions for individual folders on external drive
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.