Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have about 100 GB folder on a NTFS partition that I would like to make inaccessible in Ubuntu. TrueCrypt is not an option as there's only 5 GB of free space and there's no way to create large enough container file to move the file. Ubuntu is installed using Wubi on the same partition, so I cannot disable mounting.

With this train of thought I figured that the only option I have is to encrypt the folder using Windows Properties. So my question is if I do this will Ubuntu be able to access the folder. Will it be possible to decrypt it in case my Windows goes down?

The thing is that I want only one user to be able to access it.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Here's what I did to set this up. It works like charm now. I decided to post this as an answer so that any one with a similar situation have it:

  1. Created a EXT4 and SWAP partition with a partition manager. Boot sector got corrupted, so be careful here.
  2. Migrated Wubi to a real partition. Performance is remarkably better. More info here: http://ubuntuforums.org/showthread.php?t=1519354
  3. Moved all files files from the NTFS partition, except for the ones I was willing to protect. Used TrueCrypt from Windows to encrypt the entire non system NTFS partition. http://www.truecrypt.org/docs/?s=tutorial

Now I have my files secured both on Windows and Linux, and I am able to mount them on both ends whenever I have to.

share|improve this answer
add comment

Here are the options that I see for you. I have attempted to correct the answer that you graciously accepted before I took in account that your folder is on your Wubi /host filesystem and that makes a huge difference.

Option 1. Encrypt your folder using EncFS. You'll need enough working storage somewhere in order to create the encrypted folder. In Windows you could use encfs4win (free, "experimental") or BoxCryptor ($40) to encrypt and decrypt the folder. In Ubuntu you would use EncFS and FUSE as explained here: http://www.arg0.net/encfsintro

Option 2 (incompletely worked out). It sounds like you want to prevent some other Ubuntu users from accessing that folder when it is mounted. For that purpose, another method is to use file and directory permissions rather than encryption.

There's a difficulty here. Wubi doesn't enable you to control the Linux ownership and permissions for the individual Windows files and directories on the partition containing the virtual disk(s) (which it puts in /host). You can control the Linux ownership and permissions for the partition as a whole by editing with gksudo gedit /etc/default/grub the ntfs-3g "uid", "gid", and "umask" options in line GRUB_CMDLINE_LINUX_DEFAULT="rootflags=<options go here> quiet splash". If you need more information about the options, that can be found in man ntfs-3g.

Option 3. Move the 100 Gb folder to a separate NTFS partition or drive. Then you could use the normal /etc/fstab mechanism to mount it and the partition-level permissions and ownership would be sufficient for the access control that you need. Again you would need information about the options from man ntfs-3g.

Option 4 (incompletely explained). Converting from Wubi to a real Linux partition would make it possible to mount the Windows partition via the normal /etc/fstab mechanism. Then you could reasonably consider building ntfs-3g from source with the --enable-posix-acls in the configure command. That would give you control over permissions in a manner that is compatible between Linux and Windows. Further information: http://b.andre.pagesperso-orange.fr/permissions.html

In any case, make sure that those other users don't have root access. Normally they do not, but you'll want to be sure. To prevent specific Ubuntu users from having root access via sudo, you can "open the Users and Groups tool from System->Administration menu. Then click on the user and then on properties. Choose the User Privileges tab. In the tab, find Administer the system and [un]check that." (Quote from https://help.ubuntu.com/community/RootSudo)

share|improve this answer
    
Thanks, I'll give that a try. Hopefully, I won't mess up something since this is the same partition where the Wubi Virtual Disks are located. –  user47791 Feb 26 '12 at 11:52
    
Oh! Apologies! I will attempt to correct my answer which is unfortunately NOT relevant to your situation. You may have a solution involving the /etc/default/grub line GRUB_CMDLINE_LINUX_DEFAULT="rootflags... quiet splash", which I see here: ubuntuforums.org/showthread.php?t=1657964 –  minopret Feb 26 '12 at 13:20
    
The instructions that I gave at first are harmless because they don't apply. Your folder is visible at /host and is not seen in /etc/fstab. –  minopret Feb 26 '12 at 13:52
    
Thanks for your prompt reply. I fear that making /host with permissions 700 might make ubuntu not boot at all. I will reasearch into the way Wubi mounts the partitions during startup and will let you know if this works. –  user47791 Feb 26 '12 at 14:06
    
Otherwise the issue with options 1) and 3) is that there's only 5 GB of free space on the disk and I don't have a suitable external media to store the files temporarily (external hard drive for example). TrueCrypt supports dynamic file containers that would allow me to move the files, but apparently the Linux version does not support NTFS file containers. I may instead manage to free up 10 GB and move Ubuntu to a EXT partition instead. This way I can do watever I like with the NTFS partitionn. –  user47791 Feb 26 '12 at 14:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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