2班jackcui20160802作业

1、每日课堂笔记总结

2、预习

3、每日课堂pdf练习

4、在/data/testdir里创建的新文件自动属于g1组,组g2的成员如:alice能对这些新文件有读写权限,组g3的成员如:tom只能对新文件有读权限,其它用户(不属于g1,g2,g3)不能访问这个文件夹。

[root@centos7 /]# groupadd g1

[root@centos7 /]# chown .g1 /testdir/

[root@centos7 /]# chmod g+s /testdir/  //自动属于g1

[root@centos7 /]# touch /testdir/tes

[root@centos7 /]# ll /testdir/tes

-rw-r–r–. 1 root g1 0 Aug  3 19:57 /testdir/tes

[root@centos7 /]# groupadd g2

[root@centos7 /]# useradd -G g2 alice

 [root@centos7 /]# groupadd g3

[root@centos7 /]# useradd -G g3 tom

 

 

[root@centos7 /]# setfacl -d -m  g:g3:r– /testdir/

[root@centos7 /]# setfacl -d -m  g:g2:rw- /testdir/

[root@centos7 /]# touch /testdir/ccc

[root@centos7 /]# getfacl /testdir/ccc

getfacl: Removing leading '/' from absolute path names

# file: testdir/ccc

# owner: root

# group: g1

user::rw-

group::r-x                            #effective:r–

group:g2:rw-

group:g3:r–

mask::rw-

other::r–

 

 

5、创建组sales,gid 3000,passwd:centos,sales admins:user2

将用户user1user2,user3加入到sales辅助组

希望user1 创建新文件 默认的所属组为sales

user2将用户user3sales组移除

删除salesuser1,user2

[root@centos7 /]# groupadd -g 3000 -p centos sales

[root@centos7 ~]# useradd user2

[root@centos7 /]# gpasswd -A user2 sales

 

[root@centos7 /]# usermod -G  sales user1

[root@centos7 /]# usermod -G  sales user2

[root@centos7 /]# usermod -G  sales user3

 

[root@centos7 /]# usermod -g sales user3

 

[user2@centos7 ~]$ gpasswd -d user3 sales

Removing user user3 from group sales

gpasswd: user 'user3' is not a member of 'sales'

 

6、三种权限,三种特殊,acl,chattr 总结

见 :文件权限的设置和文件的特殊权限及其命令使用

 

原创文章,作者:jack_cui,如若转载,请注明出处:http://www.178linux.com/28341

(0)
jack_cuijack_cui
上一篇 2016-08-05 16:18
下一篇 2016-08-05 16:18

相关推荐

  • 十七周

    1、搭建一套LVS-DR模型的高性能集群,并实现以下功能:    (1)、wordpress程序通过nfs共享给各个realserver;    (2)、后端realserver中的nginx和php分离 Centos7系统 地址 安装程序 LVS主机 VIP:192.168.1.110 ipvsadm DIP:192…

    2017-08-17
  • N26-第七周

    1、创建一个10G分区,并格式为ext4文件系统;   (1) 要求其block大小为2048, 预留空间百分比为2, 卷标为MYDATA, 默认挂载属性包含acl;    (2) 挂载至/data/mydata目录,要求挂载时禁止程序自动运行,且不更新文件的访问时间戳; [root@localhost ~]# fdi…

    Linux干货 2017-03-05
  • iptables之froward

    先克隆一台centos服务器添加虚拟网卡 同时两个服务器配上host only的网卡 echo 1 > /proc/sys/net/ipv4/ip_forward打开网卡间转发 有回包 但是没有10.0.0.3还是没有ping通原因是192.168.68.134 的网关指向了192.168.68.2 而不是192.168.68.144添加一条指向192…

    2017-11-12
  • linux任务管理与计划

    linux系统作业控制的命令:     job(作业):一个作业通常包含多个命令(也有可能只包含一个),联合起来由单个小程序组合,完成复杂任务,对Linux而言作业有两种;前台作业和后台作业        前台作业(forgroud):通过终端启动,且启动后会…

    Linux干货 2016-09-13
  • 虚拟机配置网卡别名及centos 6 之bonding

    1、虚拟网卡实现一个网卡多个地址(测试环境为虚拟机),此处使用eth1网卡,并且将eth1的IP设置成固定的,其实还可以设置成DHCP自动获取,这就是Linux强大之处。但是由eth1虚拟出来的两张网卡不能使用DHCP自动获取。具体步骤如下(设置的IP看个人喜欢) [root@localhost network-scripts]# cat…

    Linux干货 2016-09-05
  • Linux 基础 (1)

    su nano shell type hash alias date cal screen echo $ tab (df bc rz(sz) ifconfig ping tty who whoami w) 1.用户  root为超级用户 1) useradd oracle  创建一个oracle用户     su &#…

    2017-07-13