手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

RHCT 模拟题库及答案

[日期:2012-06-03] 来源:Linux社区  作者:Linux [字体:大 中 小]

五、分两个分区做RAID-5,用来挂载/rhome ,大小是3G,文件系统类型是ext3

[root@ www.linuxidc.com ~]# fdisk -l      

       /dev/sda5    1301        1313      104391   fd  Linux raid autodetect

       /dev/sda6    1314        1326      104391   fd  Linux raid autodetect

       /dev/sda7    1327        1339      104391   fd  Linux raid autodetect

[root@ www.linuxidc.com ~]# partprobe

[root@ www.linuxidc.com ~]# mdadm -C /dev/md0 -l5 -n3 /dev/sda{5,6,7}

       mdadm: array /dev/md0 started.

[root@ www.linuxidc.com ~]# mke2fs -j /dev/md0

[root@ www.linuxidc.com ~]# mkdir /rhome

[root@ www.linuxidc.com ~]# vim /etc/fstab

       /dev/md0     /rhome        ext3    defaults        1 2

[root@ www.linuxidc.com ~]# mount -a

[root@ www.linuxidc.com ~]# df -h | grep md0

       /dev/md0      198M  5.8M  182M   4% /rhome

[root@ www.linuxidc.com ~]# mdadm -D -s > /etc/mdadm.conf

 

六、创建kevin,mandy,todd和erien用户,创建teacher,student组

[root@ www.linuxidc.com ~]# groupadd teacher

[root@ www.linuxidc.com ~]# groupadd student

?  kevin、todd属于teacher组(附加组),密码设置成password

[root@ www.linuxidc.com ~]# useradd -G teacher kevin

[root@ www.linuxidc.com ~]# passwd kevin

?  mandy属于student组(附加组),并且指定他的家目录是/rhome/mandy,设置密码有效期是20天, 密码任意设置

[root@ www.linuxidc.com ~]#mkdir /rhome

root@ www.linuxidc.com ~]# useradd mandy -s /rhome/mandy -G student

[root@ www.linuxidc.com ~]# chage -M 20 mandu

[root@ www.linuxidc.com ~]# chage -l mandu

?  erien属于erien组同时隶属于teacher和student组(附加组),但指定他使用的shell为/sbin/nologin, 密码任意设置

[root@ www.linuxidc.com ~]# useradd -G teacher,student erien -s /sbin/nologin

 

七、拷贝/etc/passwd到/student

?  要求该文件拥有者是root,拥有组是student

[root@ www.linuxidc.com ~]# chown root /student/passwd

[root@ www.linuxidc.com ~]# chgrp student /student/passwd

?  其它人没有任何权限

[root@ www.linuxidc.com ~]# chmod o-rwx /student/passwd

?  kevin能读写该文件

[root@ www.linuxidc.com ~]# setfacl -m u:kevin:rw /student/passwd

?  todd只能读

[root@ www.linuxidc.com ~]# setfacl -m u:todd:r /student/passwd

 

测试:

[root@localhost ~]# getfacl /student/passwd

八、创建/student/test目录,要求

?  student组的用户对此目录有完全权限

[root@ www.linuxidc.com ~]# chgrp student /student/test/

[root@ www.linuxidc.com ~]# chmod g=rwx /student/test/

?  kevin对此目录有r-x权限

[root@ www.linuxidc.com ~]# setfacl -m u:kevin:rx /student/test/

?  此目录中创建的文件,只有本人和root可以删除

[root@ www.linuxidc.com ~]# chmod o+t /student/test/

?  此目录中创建的文件,拥有组一定是student、

[root@ www.linuxidc.com ~]# chmod g+s /student/test/

[root@www ~]#chmod 3775 /student/test/

drwxrwsr-t+ 2 root student 4096 Apr  5 05:38 test

九、todd用户设置一个计划任务

?  每周一、三、六的下午三点钟,每两分钟统计一下内存的使用情况

[root@ www.linuxidc.com ~]# crontab -e -u todd

       */2     15       *       *       1,3,6     /usr/bin/free

[root@ www.linuxidc.com ~]# crontab -l -u todd

 

十、把/home缩小到1G

[root@ www.linuxidc.com ~]# umount /dev/vg/lv

[root@ www.linuxidc.com ~]# e2fsck -f /dev/vg/lv

[root@ www.linuxidc.com ~]# resize2fs /dev/vg/lv 50M

[root@ www.linuxidc.com ~]# lvresize -L 50M /dev/vg/lv

linux
相关资讯       RHCT 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款