Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some useful documents inside a folder. I want to make the folder password protected. So that if i want to access the folder it will prompt for my password.

share|improve this question

migrated from Nov 21 '09 at 12:05

This question came from our site for professional and enthusiast programmers.

not sure it's possible this way, but you can try following options:

  • Create encrypted file system and mount it manually when you need to access it
  • Use encrypted archive

But the best way to save your documents in Linux is to have a good password, right permissions on folders and reliable sysadmin.

share|improve this answer

That's not really practical. How would trying to open one of those files with vi or emacs do the password prompt?

share|improve this answer

There is no general support at the operating system level for "making a folder password-protected".

As pointed out by wallyk, it's not even clear how this would work. Every program trying to read this folder would have to prompt for a password. What e.g. about programs without a user interface (such as servers)?

The best solution is to encrypt the files, or the folder as a whole, as suggested by Elalfer. You can use e.g. gnupg (or gpg) to encrypt a file:

gnupg -c <myfile>

will prompt you for a password and create an encrypted file "myfile.gpg" from myfile. Check the encrypted file is there, then delete the original.

That said, maybe you can explain what you're trying to protect, then we can help you better.

Why are you even trying to protect a single folder? Your computer account is already protected by a password. Are you sharing your account? Are you worried about people hacking your computer? Or about theft of the machine?

Depending on what you are trying to protect, there may be different strategies to help you.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .