Reputation: 467
My website runs on a third party server, and I encountered directories with the following permissions:
folder1 drwsr-s---
folder2 drwxr-s---
folder3 drwxr-x---
I'm familiar with the d
, the r
, the w
, the x
(for folders), and the -
. While editing (in Filezilla), it seems all of these are equal to chmod 750
.
man chmod
tells me that s
stands for "set user or group ID on execution". What does that mean? And how come it maps onto the same chmod
code? Should I worry about this on the server?
Upvotes: 2
Views: 3831
Reputation: 5829
The 's' bits are referred to as the "setuid" and "setgid" bits. What it does depends on the file type.
On a directory, as in your example, these bits set the default user or group for all files created in the directory.
EG, if you have a directory owned by foo:foo, with the setuid and setgid bits set, then all files created in that directory will be owned by foo:foo, regardless of who creates them.
In your example, the "setgid" bit is set for each directory. This means that for every file created in these directories, the owner will be the user who created the file, but the group will be set to match the directory's group, rather than the user's main group.
Upvotes: 5