LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-17-2006, 10:16 AM   #1
PatrickMay16
Member
 
Registered: Apr 2005
Location: London, England.
Distribution: Debian oldstable
Posts: 56

Rep: Reputation: 53
mounting a filesystem so only one specified user can read it


Hello everyone.

I want to set the mount options in the /etc/fstab file for a hard disk I have (/dev/hda1, mounted on /media/windows) so that its contents would only be readable to my user account, "patrick", and all other user accounts could not read from it.

Here's my /etc/fstab file:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hdb1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hdb5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/dev/hda1       /media/windows  ntfs    ro,auto,uid=patrick,gid=patrick,user,fmask=0111,dmask=0000 0 0
If anyone can let me know what to put in to set things up this way, I'd appreciate it a lot.
 
Old 10-17-2006, 10:28 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Change the mountpoint to something like /home/patrick/windows or set the current mountpoint to be owned by patrick, example (as root);

chown patrick.patrick /media/windows

FYI: root will still have access to this mountpoint.
 
Old 10-17-2006, 10:48 AM   #3
PatrickMay16
Member
 
Registered: Apr 2005
Location: London, England.
Distribution: Debian oldstable
Posts: 56

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by Lenard
Change the mountpoint to something like /home/patrick/windows or set the current mountpoint to be owned by patrick, example (as root);

chown patrick.patrick /media/windows

FYI: root will still have access to this mountpoint.
Thanks, but changing ownership of the mountpoint didn't make any difference, and I need the mountpoint to stay where it is.

If anyone has any other suggestions, I'd be happy to hear them.
 
Old 10-17-2006, 11:02 AM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
could just chmod 750 /media/windows then make sure patrick is both the owner and group owner of the directory. Everyone elese would not have permissions to the directory.
 
Old 10-17-2006, 11:26 AM   #5
PatrickMay16
Member
 
Registered: Apr 2005
Location: London, England.
Distribution: Debian oldstable
Posts: 56

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by jstephens84
could just chmod 750 /media/windows then make sure patrick is both the owner and group owner of the directory. Everyone elese would not have permissions to the directory.
This didn't work either.
 
Old 10-17-2006, 11:32 AM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
When you say it didn't work are you refering in that others can still access it.
 
Old 10-17-2006, 11:34 AM   #7
PatrickMay16
Member
 
Registered: Apr 2005
Location: London, England.
Distribution: Debian oldstable
Posts: 56

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by jstephens84
When you say it didn't work are you refering in that others can still access it.
Yes, others can still access /media/windows and the files that are in it.
 
Old 10-17-2006, 11:39 AM   #8
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
what happens after you unmount it then remount it.
 
  


Reply



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
error mounting ext3 filesystem... mount: /dev/hdd1: can't read superblock versaulis Linux - Software 5 11-26-2006 08:34 PM
User with read-only permission for whole filesystem? stug Linux - General 1 04-12-2006 04:45 PM
Root filesystem mounting as Read-Only paddyjoy Linux - Newbie 11 03-21-2006 03:32 PM
how do I change the filesystem from read-only to read-write? les_chow Linux - Newbie 5 05-26-2004 03:14 PM
Mounting root filesystem in read only mode. Ocran Linux - Software 3 07-01-2002 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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