特殊权限suid sgid sticky
2015-08-14 16:46
295 查看
4 suid:当一个文件的宿主有s权限,意味着任何用户在执行此程序时,其进程不再属于其执行者,而属于这个程序文件的属主。 用于可执行文件。例:/usr/bin/passwd
2 sgid:
1 sticky: 在该目录下的文件,仅文件拥有人和root用户可删。
把目录dirtest加上sgid的权限之后,user1和user2在此文件夹中创建的文件都会属于文件夹dirtest的属组,相互之间就可以修改彼此的文件了。
2 sgid:
1 sticky: 在该目录下的文件,仅文件拥有人和root用户可删。
[root@localhost tmp]# id user1 uid=501(user1) gid=501(user1) groups=501(user1),504(gtest) [root@localhost tmp]# id user2 uid=502(user2) gid=502(user2) groups=502(user2),504(gtest)
[root@localhost tmp]# ls -l total 4 drwxr-xr-x. 2 root gtest 4096 Aug 14 08:21 dirtest
[root@localhost tmp]# chmod g+w dirtest/ [root@localhost tmp]# ls -l total 4 drwxrwxr-x. 2 root gtest 4096 Aug 14 11:44 dirtest
[user1@localhost dirtest]$ ls -l total 0 -rw-rw-r--. 1 user2 user2 0 Aug 14 12:09 a.user2 -rw-rw-r--. 1 user1 user1 0 Aug 14 12:10 b.user1user1用户和user2用户不能修改彼此创建的文件,无写的权限。
把目录dirtest加上sgid的权限之后,user1和user2在此文件夹中创建的文件都会属于文件夹dirtest的属组,相互之间就可以修改彼此的文件了。
[root@localhost tmp]# ls -l dirtest/ total 0 -rw-rw-r--. 1 user2 user2 0 Aug 14 12:09 a.user2 -rw-rw-r--. 1 user1 user1 0 Aug 14 12:10 b.user1 -rw-rw-r--. 1 user2 gtest 0 Aug 14 12:20 b.user2 -rw-rw-r--. 1 user1 gtest 0 Aug 14 12:20 c.user1
相关文章推荐
- MYGUI和HGE
- Android 常用框架、第三方、代码、UI整理
- 交互设计师应该如何设计作品集
- druid
- Android UI性能优化实战 识别绘制中的性能问题
- 如何做好团队中的Style Guide
- hadoop SequenceFile介绍 大数据 存储
- UNIQUE KEY
- UIButton的发现
- <a href="<%=request.getContextPath()%>/XXXX.jsp"> 和<a href="XXXX.jsp"> 的区别?
- iOS关闭UITableView中cell的点击事件
- HDU 1005 Number Sequence 矩阵乘法 Fib数列
- Codeforces Round #316 (Div. 2) D. Tree Requests(DFS+状态压缩)
- 编译器错误error: expected unqualified-id before 'using'| ||=== Build finished: 1
- servletFileUpload.parseRequest(request)解析为空获取不到数据问题
- iOS开发 UITableViewCell滚动到特定的行数
- ADF Model: DBSequence(讨论一) 2009-12-05 11:18:38
- UIKit Core之笔记two--->>Socket
- java基础--GUI
- UIKit Core之笔记one