I am using Ubuntu 12.04. I have 4 NTFS partitions. I have made 2 users: One for myself (Admin) and one for family (standard/non-admin).
I successfully restricted the access to my home folder from this standard user. Now I want to restrict it from accessing ALL my NTFS partitions. How can I do this?
I checked Restrict access from another user to the NTFS partition but though the answer is accepted it doesn't seem to have helped that OP either as seen in the comments later.
Open fstab file as using
You should add line in /etc/fstab file as follows,
Here
XXX
is my user id. You can find yours withid
command and/dev/sda7
is the partition I want to restrict access to.Create a folder named
EXTRA
in/media/
as follows,Now whenever you login you need to mount it as,
Done!
Explanation:
If a particular partition contains a VFAT or NTFS filesystem and you only wish to be able to access it yourself, it's pretty simple:
Include the options
"noauto", "uid=XXX", and "umask=7"
in fstab line and remove the "user" and/or "users" options if they appear there now.This means that at boot time the system will come up with that partition unmounted, and only you (operating as root, using sudo presumably) can mount it.
Once mounted, it will be owned by your unprivileged user (assuming that that user's uid is XXX, which is given to the first user created at install time in MDV installs - check with the "id" command run as that user, and adjust fstab accordingly) and will be inaccessible to all other local users.
To mount your restricted 4 partitions by issuing
mount
command four times is a boring task. To cut that boring task, I have written a shell script:Replace
/dev/sdaX
with your 4 partitions.Save as
secret-mount-unmount.sh
and then issue a commandDouble click the file and then hit
Run in Terminal
and proceed.You need to add NTFS partition to
/etc/fstab
Get device id by running
sudo blkid
. (Eg. /dev/sda1)Create mount point by running
sudo mkdir /media/mount-point
. (Eg. /media/windows)Edit
fstab
.sudo nano /etc/fstab
Add this line:
/dev/sda1 /media/windows ntfs-3g noauto,user,uid=1000,gid=1000,umask=0027 0 0
and save by clicking
ctrl+o
, then exit by clickingctrl+x
You can also refer here: https://help.ubuntu.com/community/Fstab