LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2010, 04:06 PM   #1
BlueSkull
Member
 
Registered: Sep 2009
Posts: 73

Rep: Reputation: 17
Question Setting Read permissions of a directory for root user only


I'm using ubuntu 9.10.
I used the command:

root@aduait-laptop:~# sudo chown -R root:root /media/104B-FF96/Private


to set the permissions of Private folder for root but it is giving error:

Code:
root@aduait-laptop:~# sudo chown -R root:root /media/104B-FF96/Private
chown: changing ownership of `/media/104B-FF96/Private/5.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/6.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/7.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/10.3gp': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/11.JPG': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/9.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/2.png': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/3.png': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/4.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/8.jpg': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private/1.png': Operation not permitted
chown: changing ownership of `/media/104B-FF96/Private': Operation not permitted
root@aduait-laptop:~#
partition named 104B-ff96 is fat32.
please help
tell me how can i make my folder protected.
 
Old 03-21-2010, 04:16 PM   #2
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205
FAT32 doesn't allow to change file owners using Linux chown. The owner of the files on a mounted Windows partition depends on the user who mounted that partition (see: uid and gid options of mount command).
 
Old 03-22-2010, 05:14 AM   #3
BlueSkull
Member
 
Registered: Sep 2009
Posts: 73

Original Poster
Rep: Reputation: 17
So, is there any other way if my partition is mounted I can password protect or encrypt my folder to restrict access.
 
Old 03-22-2010, 05:38 AM   #4
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205
You can mount it as root. In order to do it put something like that in /etc/fstab:

Code:
/dev/hda1 /mnt/hda1 vfat showexec,noexec,auto 0 0
which is equivalent of:

Code:
/dev/hda1 /mnt/hda1 vfat showexec,noexec,auto,uid=0,gid=0 0 0
 
Old 03-23-2010, 12:31 PM   #5
BlueSkull
Member
 
Registered: Sep 2009
Posts: 73

Original Poster
Rep: Reputation: 17
Thanks:

what will be the equivalent entry in fstab for auto mount ntfs partition with only root access privileges.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Networking 5 01-28-2014 01:33 PM
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Newbie 5 07-09-2009 09:16 PM
How can I have: Root has Read-Write, user has read only for the boot filesystem? xmrkite Linux - Software 6 10-16-2008 05:31 AM
Setting root permissions to a user? zaqwe Slackware 8 08-25-2007 06:07 PM
How do I change read/write permissions for a whole directory? Stevetgn Linux - Newbie 8 12-31-2003 08:41 AM


All times are GMT -5. The time now is 10:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration