LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-08-2004, 02:57 PM   #1
ch4s3r
Member
 
Registered: Sep 2003
Posts: 97

Rep: Reputation: 15
Setting permissions for directory


Ok i want to be able to write as a user to my windows drive which is /mnt/windows/ or /dev/hda1.

This is what the permissions are:
----------------------------------------------
ls -l /mnt/
total 44
drwxr-xr-x 2 root root 4096 Feb 27 17:25 cdrom
drwxr-xr-x 2 root root 4096 Feb 27 17:25 cdrom1
drwxr-xr-x 2 root root 4096 Feb 27 17:25 floppy
drwxr-xr-x 69 root root 32768 Dec 31 1969 windows
------------------------------------------------

This is what I've tried so far.
-------------------------------------------------
[root@cacole windows]#chown chase /mnt/windows
chown: changing ownership of `/mnt/windows': Operation not permitted

[root@cacole windows]# chgrp chase /mnt/windows
chgrp: changing group of `/mnt/windows': Operation not permitted

[root@cacole windows]# chown chase /dev/hda1
*nothing happened*

[root@cacole /]# chmod 777 /mnt/windows
chmod: changing permissions of `/mnt/windows' (requested: 0777, actual: 0755): Operation not permitted
---------------------------------------------------
i've tried all these commands as root to the /dev/hda1 as well with no success. Again this is my whole windows drive i'd like to set user access to read, write and execute, instead of just root. Thanks for your time. I'm running RH9 with kde if that matters.
 
Old 03-08-2004, 03:11 PM   #2
Rounan
Member
 
Registered: Jun 2003
Location: Ontario
Distribution: Ubuntu, Gentoo, Debian
Posts: 416

Rep: Reputation: 30
Windows (NTFS/FAT32) drives don't have permission bits like *NIX systems do. Because Linux needs some permissions, it assumes the ones you listed. To change that, you need the following options in your mount/fstab:
gid=staff,umask=0002
where gid can be whatever you like, and umask is kind of a reverse chmod - it's subtractive rather than additive. So 0002 corresponds to 776 permissions (I think - basically, rwxrwxr-x).

Note, also, that WRITING TO NTFS IS NOT STABLE AND SHOULD NOT BE USED UNLESS YOU KNOW WHAT YOU'RE DOING. If you're running a stock kernel, you won't be able to do it, period.
FAT32, you're OK.

Cheers,
--Neil
 
Old 03-08-2004, 03:14 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 58
You will need to change the permissions at mount time because the files system you are using does not support unix file permissions. You will need to add a "umask=0000" option to your fstab file or the mount command line. Please note that NTFS write support isn't considered stable yet.

edit: beaten to it
 
Old 03-08-2004, 03:31 PM   #4
ch4s3r
Member
 
Registered: Sep 2003
Posts: 97

Original Poster
Rep: Reputation: 15
ok thanks for the explanation... so your'e saying that this is what should be in the /etc/fstab file?
-------------------
/dev/hda1 /mnt/windows vfat gid=chase,umask=0002 0 0
--------------------
 
Old 03-08-2004, 04:12 PM   #5
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
You might want to change the 2 to a 3 or a 7 in the umask. This will be more restrictive for 'others'. If this is a shared drive, consider using 0113 or 0117. This way you can't accidently execute a program someone dropped in that has the same name as a program in /bin.
 
Old 08-19-2004, 03:37 PM   #6
kozaki
Member
 
Registered: Jun 2004
Location: France, UE
Distribution: Arch Linux, Mandriva x86_64, Knoppix (Kaella), Ubuntu, ...
Posts: 89

Rep: Reputation: 15
Quote:
consider using 0113 or 0117
Yeah, it might be usefull to limit the rights "group" and surely "other" may have on that directory / file(s)

But as far as i know, the first "0" is not very usefull wen giving a UMASK
i.e. umask 003 will give us the same result as umask 0003 & so on.
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting directory permissions at start redrobin77 Fedora 1 11-05-2005 01:26 PM
trouble setting directory permissions goodolday Linux - General 1 04-26-2005 04:06 PM
Need help setting permissions for a directory imsam Linux - Newbie 6 12-08-2004 10:37 AM
Automatically Setting File Permissions in a Directory maneeshsethi Linux - Security 2 05-27-2004 07:42 PM
Setting Directory Permissions is Hard ! dpaille Linux - General 1 12-12-2002 01:03 PM


All times are GMT -5. The time now is 06:01 PM.

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
Open Source Consulting | Domain Registration