How to protect a folder: password

Asked by prashan

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

Thanks
Prashan

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#1

Hi,

The process for creating an encrypted folder is described here: https://help.ubuntu.com/community/EncryptedPrivateDirectory

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 :
#2

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 :
#3

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.