"s" is a "sticky bit"

The "s" is a "sticky bit" which sets that property for all subsequently created subdirs and/or files. Depending on where the "s" is dictates if it's "suid" or "sgid"

'man chmod' will give more info

1755 gives drwxr-xr-t
2755 gives drwxr-sr-x
3755 gives drwxr-sr-t
4755 gives drwsr-xr-x
5755 gives drwsr-xr-t
6755 gives drwsr-sr-x
7755 gives drwsr-sr-t



n article <313465...@coriolis.esm.psu.edu> Bart Kimble <b...@coriolis.esm.psu.edu> writes:
>Could someone please tell me the difference in drwxr-Sr-x as
>opposed to drwxr-sr-x and how I can change the S to s.

The set-group-ID (s or S in the second triplet) bit on a directory
forces files created in that directory to be owned by the group
that owns the directory.  (They're still owned by the user that
created them.)  Thus if I create a file in a directory that does
not have set-group (permissions of drwxrwxr-x, say), it is owned
by me and belongs to my current group:

$ ls -ld foo
drwxrwxr-x   2 mww      staff        512 Feb 28 13:37 foo

$ touch foo/bar
$ ls -l foo/bar
-rw-rw-r--   1 mww      aai            0 Feb 28 13:37 bar

If the directory does have set-group (as in the two permission strings
you list above), then the file will be owned by me but belongs to
the directory's group:

$ ls -ld foo
drwxrwsr-x   2 mww      staff        512 Feb 28 13:37 foo

$ touch foo/bar
$ ls -l foo/bar
-rw-rw-r--   1 mww      staff          0 Feb 28 13:37 bar

If the directory's permissions include an S instead of an s, then
the directory has set-group but not group-execute -- which means
that members of that group cannot cd to the directory.  Usually a
pointless restriction (often people are members of more than one
group, so they can switch groups with the newgrp command and cd
into the directory, since it has execute permission for "other"...),
but that's what it means.

To change S to s, add group execute permission:

$ chmod g+x <directory name>

You may have to be root to do this.

Michael Wojcik                                                m...@mfltd.co.uk
AAI Development, Micro Focus Inc.
Department of English, Miami University


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值