1

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!

yinon
  • 1,229

2 Answers2

0

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.

G. He
  • 910
  • 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
0

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.

janos
  • 4,888
  • 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 03 '12 at 08:50