0

Im new to these forums but have been getting into Linux lately after years of windows which I only use for gaming now and I see Linux as a superior alternative for everyday use.

Im running the LXDE desktop since I really don't like the other alternatives.
I've managed to allow other login through GUI at bootup so I can login as root.

I'm dual booting Win 8.1 with Ubuntu, and I would like to totally lock down the Windows partition for security reasons. From what I gather no matter what flavor of Linux you need to be root to change drive permissions.
I would not only like to lock the Windows drive due to the fact that I know there are viruses that even if your running Linux will look for a Windows partition to infect.
So I want to lock the windows drive and set all permissions to list files only for root and nothing for other users.
I tried doing this through GUI and root. Thing is when I right click on the drive I see no option for permissions and if I go into the drive itself and right click folder properties upon changing permissions there is no effect.

My /etc/fstab is:

# /etc/fstab: static file system information. 
# 
# <file system> <mount point> <type> <options> <dump> <pass> 
#Entry for /dev/sda5 : 
UUID=65914ae6-cb45-4f13-9674-ba462abbddd2   / ext4  errors=remount-ro   0   1 
#Entry for /dev/sda1 : 
UUID=90A60406A603EC12   /media/System_Reserved ntfs-3g  defaults,locale=en_US.UTF-8‌​   0   0 
#Entry for /dev/sda2 : 
UUID=C8D2169CD2168F36   /media/sda2 ntfs-3g defaults,locale=en_US.UTF-8 0   0 
/dev/mapper/cryptswap1  none    swap    sw  0   0 
#UUID=2c56d661-4571-416c-836a-e7d6c8cb1160  none    swap    sw  0   0

Can someone please help me with this so I can have peace of mind when I'm using Linux and I will know for sure my windows drive is safe?

  • Linux permissions do not work on a Windows file system. However, you can restrict the access of the mount point (something like /mnt/windowsdrive) to root only. – Jos Jul 25 '14 at 12:18
0

Hi and welcome to askubuntu,

It seems you're interested in the security of your computer, which is good. The first thing you should do is not login as root if you do not need to. This is pretty much the biggest security risk you can have.

Having said that, the easiest way to 'lock' your windows partition is probably not to mount it in the first place (or mount it read-only). You can change this by editing /etc/fstab and comment out the line that is your windows partition by placing a # in front of it. You do need to use sudo to edit /etc/fstab, so be carefull. If you comment the line out you can undo it by removing the # again.

To figure out which partition your windows partition is you can use the GUI method of disks or system monitor, via cli you can use sudo fdisk -l.

0

Set the uid,gid and umask mount options:

mount -o rw,exec,uid=0,gid=0,umask=077 -t ntfs-3g /dev/something /mount/point 

Or, equivalently, make an fstab entry with these options:

cat <<EOF | sudo tee -a /etc/fstab 
/dev/something /mount/point ntfs-3g rw,exec,uid=0,gid=0,umask=077 0 0
EOF

This will make everything on the mounted partitions owned and accessible only by root. Remember to replace /dev/something and /mount/point with appropriate values.

The above command assumed that your fstab doesn't already have an entry for the drives. From your fstab, you already have entries, so edit fstab using sudo gedit /etc/fstab and modify the corresponding lines.

  • How do I know what mount point is? I know what to put in /dev/something but not mount point – myhatisgreen Jul 26 '14 at 9:42
  • @myhatisgreen mount point is the directory where the files from the partition well appear, like /media/My\ Stuff, /home/myhatisgreen/windows_files, etc. The folder must exist. – muru Jul 26 '14 at 10:55
  • They are not folders. Its the windows partitions, sda1 and sda2, so what should I put? – myhatisgreen Jul 26 '14 at 11:20
  • Also concerning the fstab method, how do I edit fstab? When I try and open it, it says read only. – myhatisgreen Jul 26 '14 at 11:22
  • @myhatisgreen the mount points are folders where you want the files from the windows partitions to appear. To edit fstab, use sudo: sudo gedit /etc/fstab. – muru Jul 26 '14 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.