Linux – Prevent users from seeing and accessing file system beyond $HOME

linuxpermissions

On Windows it is possible to "hide" contents of the drive, system folders from unprivileged users and let them only access files from their user directory. In this case even when users do File/Open they only see their user directories.

Is there any way to achieve the same on Linux? So that when user logs in to remote server he is only able to access his own files.

UPDATE: On remote server users can run GUI applications. Ultimate goal is to prevent them from seeing system internals in File/Open and the like and also prevent them from accessing, say, /etc/passwd if they type in full path to that file.

Best Answer

Short answer is no. In order for the user to interact with their data they need to use programs (bash, ls, cat, vi....). In order to use these programs the user must be able to list the directories they are contained within and read from the files which contain the programs.

You can prevent users from accessing other users data files by settings the permissions (and permissions mask) appropriately and/or restricting the access via chroot (but they can still see the config and executable files they have access to).

Ultimate goal is to prevent them from seeing system internals in File/Open

This is somewhat meaningless as an Ultimate goal - what is the threat model? How could they gain / subvert the security by doing so?

Related Topic