The Capital S in Linux Permission Bitmap

昨天某人丢过来一个问题,为啥Linux下有的文件权限是-rws,有的是-rwS,当时就没想法了,后来某人被逼求助于Google顺便把结果发给了我,顺便记一下吧~

首先,这个S,不管大写还是小写都是setuid/setgid bit, 大小写的不同之处在于,大写的S表示这个文件没有x位,而小写的则是一般常见(这个只是我常见的哈,有空查查,如果大S比较常见俺会上来改的)的即是有x权限的。即在chmod中,如果是4755的话,那么它的权限就是通常的-rwsr-xr-x,如果是4655的话,就是大写的-rwSr-xr-x。就这么些东西。

最后多一句嘴,第一位的那个4其实也是bitmap,4代表setuid bit,2代表setgid bit,1代表sticky bit。下面木有了~~

This entry was posted in 小企鹅Linux and tagged , . Bookmark the permalink.

One Response to The Capital S in Linux Permission Bitmap

  1. xrdavies says:

    suid…..好吧,一般不会用到。。

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>