Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
2  
belong to superuser.com –  RageZ Nov 20 '09 at 5:34
1  
Everybody - Don't add the [belongs-on-superuser] tag, just comment. Sunil - this question will soon be migrated. Head over to SU create and associate an account so you'll have ownership of the question –  ChrisF Nov 20 '09 at 12:47
add comment

migrated from stackoverflow.com Nov 21 '09 at 12:05

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

3 Answers

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
add comment

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
add comment

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
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.