Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to block any kind of access to a certain directory unless a password is provided. It could be my root or account password.

The directory is residing on an NTFS partition, and this method needs to work for Windows as well, as I'm accessing the partition from both Linux and Windows interchangeably.

It could be implemented as encryption.

How do I achieve this?

share|improve this question
1  
If you can live with mounting and unmounting the directory manually when you need and are done with it, I suppose you could do that using something like Truecrypt. That'll also protect the contents from both sides of the OS barrier, something that only OS facilities rarely do. –  Michael Kjörling Dec 21 '12 at 9:39
1  
What is your OS? Apart from that - a filesystem is not an interactive gui. Where should that prompt go to when a script with no controlling tty touches that directory? –  Nils Dec 21 '12 at 21:52
    
What do you want to do that for? Why do you think that is the best way of getting there? –  vonbrand Jan 22 '13 at 1:25
add comment

2 Answers

up vote 0 down vote accepted

TrueCrypt, or another encryption method, is probably the way to go with this.

share|improve this answer
add comment

Add ‘nouser’ option to the line in fstab which mounts your NTFS partition.

nouser is included in defaults macro (see man mount) The opposite options users and user shoudn’t be present.

share|improve this answer
    
This does nothing to protect the directory once the file system is mounted. It also does nothing to protect the directory from the Windows side. –  Michael Kjörling Dec 21 '12 at 9:37
    
As OP said ‘It could be my root or account password’. in case of no ordinary user can mount filesystem, the root password is required. So it will work for linux, and you are wrong in your humble opinion that it does nothing. –  tijagi Feb 4 '13 at 17:57
    
The OP also said "this method needs to work for Windows as well". And btw, I didn't downvote. –  Michael Kjörling Feb 5 '13 at 10:27
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.