Operating System - Linux
1829582 Members
20894 Online
109992 Solutions
New Discussion

Re: File & Directory Permission

 
girishb
Frequent Advisor

File & Directory Permission

Hi there,

We have a Redhat Enterprise Linux Server. I need to add a user account (user1) and this user must have only Read Access to entire directory structure.

Its kinda urgent, so please help.

Thanks
Girish
4 REPLIES 4
Bill Thorsteinson
Honored Contributor

Re: File & Directory Permission

Change the owner of the directory structure
to another user (nobody or root) but
allow the users group to access the directory
tree. You can setup a group specifically
for the user.
Change the directory permissions to 755 or 750.
Try 'chmod -R go-w' on their home directory.
Once the directory is fully populated you
could even remove write access for the owner
with 'chmod -R u-w'

Ivan Ferreira
Honored Contributor

Re: File & Directory Permission

For these kind of users, you should use a restricted shell.

http://w3.pppl.gov/info/bash/The_Restricted_Shell.html

Only internal commands and commands found in the PATH environmental variable are executed. If you configure the PATH variable to have only a few commands or no commands, read only access will be granted.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
girishb
Frequent Advisor

Re: File & Directory Permission

Can we use setfacl command.

I need assistance, I'm a newbie :)
Ivan Ferreira
Honored Contributor

Re: File & Directory Permission

You could, but setting acls increases the installation complexity, that can derivate in errors or false sense of security if it's not correctly managed. Also the backup application should be able to store the ACL attributes. ACLs are not recommended by me.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?