How to password protect a folder on Unix/Linux without encryption?

The easiest way would be to change the permissions of the files to not be readable by anyone other than the owner. Once that is done, a user would have to either log in as you (which should require a password) or sudo as root (which also should require a password). To change the permissions, simply use the following command on any files you don't want others to have access to.

chmod og-rwx filename

This assumes that when you are not on the machine, your screen is locked and there is a password for your account as well as the root account.


Create a new user (with password) for this protected files/directories.

Then log in / sudo to root and give this commands (replace $newuser with the new user account name ;):

chown $newuser filename directoryname
chmod og-rwx filename directoryname

This way, the files and directories are even save when you don't log out and have your screen not locked for some reason.

This assumes, that a) you are not constantly logged in as root or any other account with special administrative rights, b) root (and any other user account with administrative rights) has a password set, c) sudo is not configured to skip password test (or in more general: entering the password is required for all log-in operations). d) every one with administrative access logs out when she leaves the terminal - even if only for a short time like 2 minutes.

/edit to reflect R Schultz'es comment