5

I have bought a VPS and I am busy with setting up a FTP server. This is working now, but i can give only one account owner rights. So i have made a group 'administrators' with 2 users. The problem is that i can give only one user owner rights. Now i am using the next code:

chown -r user1:administrators /var/websites
chown -r user2:administrators /var/websites

Only the last user(user 2) has now owner rights. What must i do to give both users administrator rights?

Tom

3 Answers3

6

Change the directory's group ownership with

chgrp -R administrators /var/websites

then change the group permissions for that directory using chmod

chmod -R g+rwx /var/websites

substitute rwx with the permissions you want to give your administrator users

3

Just like anything on a *nix system, there are many ways to do it.

To use groups, set the umask to 002 and do the following

find /var/websites -type d | xargs chmod 775
find /var/websites -type f | xargs chmod 664

That should give the group read/write access to all files and directories.

If you're filesystem supports it which it probably does (most likely ext3), you can also use ACLs. Do a Google search for "Linux acl" and that should give you some howtos.

Finally, you can always do the hackerish thing which is to set the UIDs for both users the same. The name is arbitrary, the UID is really what gets used when looking at permissions so just have two users with the same UID and that should work as well but be aware that if you have other stuff you want to protect from each user, that won't work as they will be effectively the same user and have all the same privileges.

Jim
  • 131
2

Permissions on Unix filesystems only have one user. Use group permissions to give multiple people write access.

outis
  • 479