2017年7月13日 星期四

Linux OS Class [20170712x2] SUID/ SGID ACL

[root@server0 ~]# cd /srv
[root@server0 srv]# ll
total 64
-rwxr-xr-x. 1 root root 54048 Jul 12 19:46 cat
drwxrwxrwT. 4 root root    47 Jul 12 20:33 share
-rw-rw----+ 1 root root    16 Jul 12 19:46 test
[root@server0 srv]# mkdir doc
[root@server0 srv]# ll
total 64
-rwxr-xr-x. 1 root root 54048 Jul 12 19:46 cat
drwxr-xr-x. 2 root root     6 Jul 12 20:58 doc
drwxrwxrwT. 4 root root    47 Jul 12 20:33 share
-rw-rw----+ 1 root root    16 Jul 12 19:46 test
[root@server0 srv]# groupadd manager
[root@server0 srv]# usermod -aG  manager mary
[root@server0 srv]# usermod -aG  manager jerry
[root@server0 srv]# id mary
uid=1001(mary) gid=1001(mary) groups=1001(mary),1003(manager)
[root@server0 srv]# id jerry
uid=1002(jerry) gid=1002(jerry) groups=1002(jerry),1003(manager)
[root@server0 srv]# getfacl doc
# file: doc
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

[root@server0 srv]# setfacl -m g:manager:rwx doc
[root@server0 srv]# getfacl doc
# file: doc
# owner: root
# group: root
user::rwx
group::r-x
group:manager:rwx
mask::rwx
other::r-x

[root@server0 srv]# setfacl -m u:jerry:r-x doc
[root@server0 srv]# getfacl doc
# file: doc
# owner: root
# group: root
user::rwx
user:jerry:r-x
group::r-x
group:manager:rwx
mask::rwx
other::r-x

沒有留言:

張貼留言

dorowu/ubuntu-desktop-lxde-vnc:bionic-lxqt Docker 映像介紹

 dorowu/ubuntu-desktop-lxde-vnc:bionic-lxqt Docker 映像介紹 1. 基本概述 名稱: dorowu/ubuntu-desktop-lxde-vnc:bionic-lxqt 維護者: Dorowu 用途: 提供基於 Ub...