Understanding chmod, chown
Hi. I'm currently trying to get my head around file permissions.
As I understand it, if I apply 'chmod g+rs' to a directory, what should happen is that 'r' allows the group to read all files in the directory and 's' allows the group to access the contents of the directory, like 'x'. This bit is fine. However, 's' is also supposed to force all files in the directory to the same group as the directory, which is the bit giving me trouble.
I created a directory, dir1, and put some files into it (file1, file2 etc). I changed the ownership of the files with chown :group1 *
At this point, the ownership of dir1 is user1, users. The ownership of all files in the directory is user1, group1.
If I now do chmod g+s dir1, the group permissions to dir1 are changed to r-s, but the files in dir1 are unaffected. I assume I have misunderstood the phrase, ' force all files in the directory to the same group as the directory'.
What is it that 's' does when applied to a directory for a group?
Mike.
|