May be too naive but how about the following:
Dir be the directory to be password protected with password
mv -n Dir qwerty
mv qwerty Dir/.
chmod a-r Dir
This just creates a folder called
Dir with the contents of
Dir and removes read permissions to
To access from terminal:
Note that pressing tab or typing
ls won't reveal
qwerty. In other words you need to know
qwerty to reach the original contents of
To access from nautilus:
Dir. Press Ctrl+L. Type
qwerty in the location bar to enter.
mv qwerty newpassword
This method has quite a few issues.
- After gaining access the password will be clearly visible for all to see in the terminal prompt or nautilus address bar.
- Scripts inside
Dir which depend on their exact location in the filesystem won't work properly.
- Most importantly, sys-admins will be able to access contents without the password - this may not be desirable.
Apart from these there could be other security flaws: this was never intended to be an encryption scheme. That said, from the sound of the question, I guess this might be sufficient.