0

My user id is 1000 and second user id is 1001

and my fstab entry for the drives are

# /media/Data_Ext4 was on /dev/sda7 during installation
UUID=1c2862cf-5838-49a7-bcef-715319a7841e /media/Data_Ext4 ext4    defaults,nofail,uid=1000       0       0

# /media/NTFS was on /dev/sda3 during installation
UUID=4A94A52994A51889  /media/NTFS     ntfs    defaults,uid=1000                             0       0

but still uid=1001 can access these drives as mounted volumes....

3
  • 1
    ... and what about the group? Have you tried adding gid=1000? Dec 20, 2011 at 8:56
  • ading gid=1000 lead to error during mounting
    – joe1983
    Dec 20, 2011 at 10:48
  • Perhaps gid=119 would have been a better idea. 119 is the admin group Dec 20, 2011 at 13:34

1 Answer 1

1

Make sure that the mount command does not have a Set UID permission set on it. A set UID permission allows a script to execute as the creator instead of the invoker. Lets say root owns/created the file, if you run it and it has that permission you're effectively root.

By changing this permission normal users can't use mount without sudo.

4
  • tried changing using chmod 0641 for /bin/mount ....no effect
    – joe1983
    Dec 20, 2011 at 11:20
  • ls -la, see if the change took properly, mount shouldn't have any types of odd background or font color if it did. Dec 21, 2011 at 7:23
  • ls -la /bin/mount -rw-r----x 1 root root 88716 2011-08-09 21:45 /bin/mount
    – joe1983
    Dec 22, 2011 at 14:02
  • Notice that last X on there? chmod anything as a 1 and that sets executable. You want 4 or 0 for readonly or no access. Remember this goes back to binary: RWX 000 = none; 001 = execute only; 100 = dec 4, readonly; Just remember that. Dec 27, 2011 at 11:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .