0

assuming there is only one user account on the OS, it does not belong to the root group is there any command line which i could enter at the terminal (by su to become root) to restrict viewing of the folder contents? (not deny read write by the system). Thanks!

1 Answer 1

-1

The read permission is required to get a directory listing. If the user is not in the owning group of the directory…

chmod o-r /path/to/directory

otherwise,

chmod go-r /path/to/directory

That said, the user can still go into the directory, and potentially open further files or directories therein. You must remove the executable permission on the directory to disallow this.

chmod o-x /path/to/directory

or

chmod go-x /path/to/directory

Be careful when removing the owning group's permissions, as some of them are required for some daemons to properly function. You should just remove the user from the group instead.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .