How to give file permission to a specific user in a Group? How to give file permission to a specific user in a Group? linux linux

How to give file permission to a specific user in a Group?


Assuming Bob can own the file the following should work for you.

$ chown Bob:g1 file1

First set the ownership of the file to Bob to allow for read+write access and set the group ownership to the g1 group.

$ chmod 640 file1 

Set the owner to a read and write and set the group to read only. This is a common permission structure on webservers. Note that the "world" has no permissions in this structure, but $ man chmod can provide further information on file permissions and get you where you are needing to go. Additionally if you need more control over your permissions across the whole system you may want to look into Posix ACLs or SE Linux as you did indicate you are on RedHat


You may try like this in Linux:-

chown user_name filechown user_name folderchown -R user_name folder #recursive