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.

Possible Duplicate:
Is there a way to password protect individual folders?

Something without creating new filesystem/emcrypted-partition, do you know a good program?

Thanks!

share|improve this question

marked as duplicate by hhlp, izx, nitstorm, htorque, jokerdino Aug 19 '12 at 15:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

There is a couple of ways to do this.

1) using crypt command. This command can encrypt and decrypt a file for you. (you might need to install it by 'sudo apt-get install mcrypt').

2) change read permission for the directory.

share|improve this answer
    
is there something like when I click on the folder it's asking password? is it like this? –  yinon Apr 27 '12 at 14:55

You can create/mount an encrypted directory with encfs like this:

mkdir -p ./content
encfs -i 5 $PWD/raw $PWD/content

The first time you do this it will ask some questions, you can accept the defaults, and it will ask for a password which you will have to enter later every time to unlock.

The encrypted content will be created under $PWD/raw, which will be mounted on $PWD/content. You can create files in $PWD/content or just copy there, and you will see that $PWD/raw gets populated with unreadable data. $PWD/content is visible only by your user, not even root can see it. When you are done editing, unmount with fusermount -u ./content, this will wipe out the content of $PWD/content. To mount again, repeat the encfs command above.

The path parameters for encfs must be absolute paths, that's why I used $PWD above, to use directories in the current working directory.

The -i 5 means unmount automatically after idle for 5 minutes.

share|improve this answer
    
i need something to ask password even in my user-private data that in user i allow to everyone enter, but not to that folder. thanks! –  yinon Apr 28 '12 at 17:43
    
Yes, it will ask for your password every time you mount the encrypted directory (with the command above). I'm not sure what you mean by "allow everyone". When you mount the encrypted directory the contents are visible only by your user id, not by any other user including root. I suggest you give it a try and you'll see, it's very easy. You can install encfs with apt-get. –  janos May 3 '12 at 8:50

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