Win 7系统 Win10系统 XP系统 系统故障 系统安装
您的位置: 首页 > 故障 > linux

linux下常见的权限问题

日期: 2014-07-29   浏览: 130

  linux下开发中会遇到一个常见的问题就是权限问题。

  多个开发人员共同开发一个项目,如何管理唯一的一个运行环境的权限?

  有两个可行的方案:

  1、使用SETGID BITS

  使用SETGID BITS可以在创建目录时将新建目录的组默认继承上级目录。

  man chmod中的说明:

  SETUID AND SETGID BITS

  chmod clears the set-group-ID bit of a regular file if the file’s group ID does not match the user’s effective group ID or one of the user’s supplementary

  group IDs, unless the user has appropriate privileges. Additional restrictions may cause the set-user-ID and set-group-ID bits of MODE or RFILE to be ignored.

  This behavior depends on the policy and functionality of the underlying chmod system call. When in doubt, check the underlying system behavior.

  用法:

  chgrp group_name dir/chmod g+s dir/

  2、使用文件访问控制列表 setfacl

  setfacl -m d:g:group_name:rwx dir/

相关资讯:
精彩专题:
最新应用:
最新系统下载: