[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Weird File Permissions



On Wed, Nov 07, 2001 at 10:42:37PM +0000, Aniartia wrote:
> On Wednesday 07 November 2001 22:33, Sunny Dubey wrote:
> > hey,
> >
> > what does it mean to have an S or an s when doing ls -l ??
> >
> > (sunny@lily)(/)$ ls -l | grep home
> > drwxrwsr-x    8 root     staff        1024 Oct 15 12:02 home
> 
> I thought s = execute with SUID 
> And this is the point where I get told I'm totaly wrong! ;)

First part:

S means the SUID/SGID bit is set but the execute bit is not.

S means the SUID/SGID bit is set and the execute bit is also set.

Second part:

SGID on a directory means files and subdirectories created in that
directory should inherit group ownership, even if the user's default
group is not the group owning this dir (hope that makes sense).

Sometimes it's easier to think of permissions in octal rather than the
symbolic representation.

00400     -r--------
00660     -rw-rw----
00777     -rwxrwxrwx
01777     drwxrwxrwt (I cheated and made this a dir since it only
    makes sense there; see /tmp.  This is the "sticky bit")
02755     -rwxr-sr-x (Typical SGID binary; see /usr/bin/write)
02775     drwxrwsr-x (Typical SGID directory; see /usr/src)
02700     drwx--S--- (SGID directory which has no group permissions)
04755     -rwsr-xr-x (Typical SUID binary; see /usr/bin/chsh)

HTH,

-- 
Nathan Norman - Staff Engineer | A good plan today is better
Micromuse Ltd.                 | than a perfect plan tomorrow.
mailto:nnorman@micromuse.com   |   -- Patton

Attachment: pgpVeRO_TxV50.pgp
Description: PGP signature


Reply to: