0

I have a folder called servers, and I need to make it, and all its contents accessible to both surge and minecraft.

I tried

chmod -R minecraft+surge servers

it replies

chmod: invalid mode: ‘minecraft+surge’
Zanna
  • 70,465

1 Answers1

3

Permissions are cool. There are two ways to do this:

User Groups

The "UNIX way" to do this is to create a new group servermanagers or similar, and make that the folder's owning group:

sudo groupadd servermanagers
sudo usermod -aG servermanagers minecraft
sudo usermod -aG servermanagers surge
sudo chown -R :servermanagers servers/
sudo chmod 755 servers/

You could also just use the surge or minecraft default groups and just set either of those groups as the owner (though this may do some interesting permission things). However, it gets annoying to have groups for this, so enter...

ACLs

If your system supports ACLs (EXT4 hard drives will automatically do this), you can just use an ACL:

sudo setfacl -Rm u:minecraft:rwx servers/
sudo setfacl -Rm u:surge:rwx servers/
sudo getfacl -a servers/ | sudo setfacl -d -M- servers/

Of course, be sure that your system supports ACLs. See man setfacl for more information.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172