Linux: how to create a super user

linuxpermissionsuser-management

I have three users:

  • user_1,
  • user_2, and
  • user_super.

There are two directories,

  • /root/user_1 (chown -R user_1:user_1)
  • /root/user_2 (chown -R user_2:user_2)

I want my user_super to be able to modify these files and be able to chown it back to original.

user_1 and user_2 cannot read/change each others files and are jailed to their root folders.

How do I go about that?

PS: user_super should have no root permissions, user_super will run apache on the server so, it should be as close as possible to www-data (Apache) user.

Best Answer

Set the group sticky bit (chmod g+s ) on a directory, so that newly created files inherit the group ownership and group permissions. It will help in case you are dealing with apache hosting and multiple ftp-users.

We circumvent this problem on our servers in apache vs. ftp-users by running apache with mod_itk and setting the vhosts to be run with ftp ownership permissions.