Q: What is the "s" in drwxr-s-- when I enter ls -l?
A: Review Power Tools 1.23 and 22.05.
% which passwd
/usr/bin/passwd
% ls -l /usr/bin/passwd
-r-sr-sr-x 3 root sys
96392 Jan 19 1999 /usr/bin/passwd*
Overall, don't worry too much about SUID and GID. In general, you
should stick to rwx for
setting file permissions.
% chmod who1=perms,who2=perms,..... file
Each who means, u, g, o, or a combination.
Each perms means r, w, x, or some of the other
bits available. (See man chmod)
The man page refers to the equals as "setting absolutely". This term
means that
the equals sign tells chmod to set only the perms
entered for the who.
Example)
% chmod g=r file
sets r-- on file for group. This command added r and removed x and
w for group.
To remove permissions entirely, try
% chmod u=rwx,g=---,o=--- file
(no spaces between the commas!)
or
% chmod g=,o= file
See also 22.08 in the Power Tools book for an interesting -- and undocumented -- feature of chmod using "=".
Back to Top
Back to Information
Back to CS114 Home