How to protect a folder: password

Asked by prashan on 2010-06-04

I have a folder that shouldn't be viewed by others.
What is the easiest way to do it in Linux


Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andrea Corbellini (andrea.corbellini) said :


The process for creating an encrypted folder is described here:

It should contain all the information you need. If not, feel free to ask for any doubt you have.

Revision history for this message
actionparsnip (andrew-woodhead666) said :

I'd just set the owner to your username and usergroup then chmod it to 600

so for a user foo and a folder named bar

chown foo:foo ./bar; chmod 600 ./bar

Now only your usrname can access the data

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :

Setting permissions is not a safe way to protect data against people. In fact, any person that can use `sudo` will be able to see any folder. Also any person with physical access to the machine may see the data, if not encrypted: for example, you can view files using a live CD or, in the worst case, putting the hard disk on an another computer.

This is why I think that encrypting the directory is the best way to restrict access to it.

Can you help with this problem?

Provide an answer of your own, or ask prashan for more information if necessary.

To post a message you must log in.