4.25 作业

#1、创建g1组,要求创建一个属于redhat用户g1组的文件redhat.txt

root@localhost \~\]# groupadd g1 \[root@localhost \~\]# touch /root/redhat.txt \[root@localhost \~\]# ll /root/redhat.txt -rw-r--r--. 1 root root 0 4月 26 20:19 /root/redhat.txt \[root@localhost \~\]# chown xnj1 redhat.txt \[root@localhost \~\]# chgrp g1 redhat.txt \[root@localhost \~\]# ll /root/redhat.txt -rw-r--r--. 1 xnj1 g1 0 4月 26 20:19 /root/redhat.txt **#2、新建/sc目录,所属组为group组,root用户和group组用户可在该目录下创建文件,其他人无任何权限** \[root@localhost \~\]# groupadd group \[root@localhost \~\]# mkdir /sc \[root@localhost \~\]# ll -d /sc drwxr-xr-x. 2 root root 6 4月 26 20:34 /sc \[root@localhost \~\]# chmod o-rw /sc \[root@localhost \~\]# ll -d /sc drwxr-x--x. 2 root root 6 4月 26 20:34 /sc \[root@localhost \~\]# chmod o-x /sc \[root@localhost \~\]# ll -d /sc drwxr-x---. 2 root root 6 4月 26 20:34 /sc \[root@localhost \~\]# chmod g+w /sc \[root@localhost \~\]# ll -d /sc drwxrwx---. 2 root root 6 4月 26 20:34 /sc **#3、新建/cw目录为财务部存储目录,只能对财务部人员可以写入,并且财务部人员所建立的文件都自动属于mygroup组中** \[root@localhost \~\]# mkdir /cw \[root@localhost \~\]# groupadd mygroup \[root@localhost \~\]# chgrp mygroup /cw \[root@localhost \~\]# ll -d /cw drwxr-xr-x. 2 root mygroup 6 4月 26 20:37 /cw \[root@localhost \~\]# chmod o-rx /cw \[root@localhost \~\]# chmod g+w /cw \[root@localhost \~\]# ll -d /cw drwxrwx---. 2 root mygroup 6 4月 26 20:37 /cw **#4、设置helen用户对于/sc和/cw目录可读、可写、可执行** \[root@localhost \~\]# useradd helen \[root@localhost \~\]# chmod 777 /sc \[root@localhost \~\]# chmod 777 /cw **#5、设置/test目录为公共存储目录,对所有用户可以读、写、执行,但用户只能删除属于自己的文件。** \[root@localhost \~\]# mkdir /test \[root@localhost \~\]# chmod 777 /test \[root@localhost \~\]# chmod o+t /test \[root@localhost \~\]# ll -d /test drwxrwxrwt. 2 root root 6 4月 26 20:53 /test **#6、在/test/dir里创建的新文件自动属于temp组** \[root@localhost \~\]# mkdir /test/dir \[root@localhost \~\]# groupadd temp \[root@localhost \~\]# ll -d /test/dir drwxr-xr-x. 2 root root 6 4月 26 20:58 /test/dir \[root@localhost \~\]# chgrp temp /test/dir \[root@localhost \~\]# chmod g+s /test/dir \[root@localhost \~\]# chmod g+w /test/dir \[root@localhost \~\]# chmod o+w /test/dir

相关推荐
pound12718 分钟前
Linux
linux·运维·服务器
@CLoudbays_Martin1122 分钟前
为什么动态视频业务内容不可以被CDN静态缓存?
java·运维·服务器·javascript·网络·python·php
盟接之桥2 小时前
盟接之桥说制造:在安全、确定与及时之间,构建品质、交期与反应速度的动态平衡
大数据·运维·安全·汽车·制造·devops
learning_tom2 小时前
HTML图片标签及路径详解
linux·服务器·php
dbdr09013 小时前
Linux 入门到精通,真的不用背命令!零基础小白靠「场景化学习法」,3 个月拿下运维 offer,第二十六天
linux·运维·服务器·网络·python·学习
大白的编程日记.3 小时前
【Linux学习笔记】信号的深入理解之软件条件产生信号
linux·笔记·学习
鹧鸪云光伏与储能软件开发3 小时前
投资储能项目能赚多少钱?小程序帮你测算
运维·数据库·小程序·光伏·光伏设计软件·光伏设计
群联云防护小杜3 小时前
服务器异常磁盘写排查手册 · 已删除文件句柄篇
运维·服务器·nginx·开源·lua
buyutang_3 小时前
C/C++ Linux系统编程:线程控制详解,从线程创建到线程终止
linux·c语言·c++·学习
liliangcsdn3 小时前
结合prompt分析NodeRAG的build过程
java·服务器·人工智能·数据分析·知识图谱