1

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.

0

3 Answers 3

2

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.

0

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

0

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.

You must log in to answer this question.

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