Sticky bit is a permission bit that is set on a file or a directory that lets only the user/owner of the file/directory or the root user delete or rename the file, even when write permissions are given through group ownership.
Sticky bit can be set with:
chmod +t /directoryname
After this, users with write permission should not be able to delete files inside that folder unless they created the file/folder themselves. You can also make all files in that folder inherit group ownership, by using:
chmod g+s /directoryname
I just did a little test to make sure. I created a folder named
testfolder, with ownership
root:user1. I set
775 permissions (
rwxrwxrw) and then ran:
sudo chmod +t testfolder
to give it sticky bit, and:
sudo chmod g+s testfolder
to make new files inherit group ownership.
After that, I logged in with
user2, which is group member of
user1. I went inside the folder and tried to delete the
testfile that had
rwx permissions for group
user2 is a member of that group, they should have permissions to delete it, but they didn't. Permission denied.
After that, I decided to remove the sticky bit, using:
sudo chmod -t testfolder
and then tried to delete the file again. It worked.
Not sure if this is what you are looking for since you don't want users to use
mkdir. This would only disallow them deleting stuff while keeping write.