RHCSA 考试
在这次考试中,你将用到两个系统,一个系统就是你座位旁边的物理机,另一个系统是位于物理机上的虚拟机,这个虚拟机已经预安装了Redhat Enterprise Linux,防火墙配置默认是开启的,除非特别指定,所有考试题目都只能在虚拟机里操作,你没有权限使用root登陆物理机器,但是必要的时候你可以利用它去测试你在虚拟机做的一些服务。
注意,在考试期间不允许你和其他的考生交流,也不允许连接到其它考生的机器上,测试用的机器和网络都将被监控,误操作以上两点可以导致您考试分数为0.
开始之前,你应该检查下面的连接中列出的一些一般性的配置信息: 附加的配置信息
考试要求
完成下列操作,当你收到成绩时,这部分的成绩会标记成RHCSA,并且只有一个总分,您必须获得300分中的210分,才能获得认证。
密码更改: a 1 passwd exit 网络配置
System-config-network
1. 一个YUM源已经提供在了http://instructor.example.com/pub/rhel6/dvd配置你的系统,并且能正常使用
vi /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=http://instructor.example.com/pub/rhel6/dvd gpgcheck=0
yum list
2. 调整逻辑卷home的大小,它的文件系统大小应该为300M,确保这个文件系统的内容仍然完整,注意:
分区很少能精确到和要求的大小相同,因此在范围320M到350M之间都是可以接受的 vgdisplay
lvextend–L +xM+path resize2fs +path df -TH
3. 创建下面的用户、组和组成员关系 名字为sharegrp的组
用户natasha,使用sharegrp作为附属组 用户harry,也是用sharegrp作为附属组
用户sarah,在系统上不能访问可交互的shell,且不是sharegrp的成员,natasha,harry,sarah密码都是nimsdreg groupaddsharegrp
useraddnatasha–G sharegrp usermod–G sharegrp harry useraddsarah–s /sbin/nologin echoredhat |passwd–stdin (+id) id (+id)
4.复制文件/etc/fstab到/var/tmp/fstab。配置/var/tmp/fstab的权限如下: 文件/var/tmp/fstab所有者是root 文件/var/tmp/fstab属于root组
文件/var/tmp/fstab不能被任何用户执行 用户natasha可读和可写/var/tmp/fstab
用户harry 既不能读也不能写/var/tmp/fstab
所有其他用户(现在和将来)具有读/var/tmp/fstab的能力 cp /etc/fstab /var/tmp/fstab ll /var/tmp/fstab
setfacl–m u:Natasha:rw /var/tmp/fstab setfacl–m u:harry:0 /var/tmp/fstab
5.用户natasha必须配置一个cron job,当地时间每天14:23运行,执行: */bin/echo howdy crontab–u natasha–e
23 14 * * * /bin/echo howdy crontab–u natasha -l
6.创建一个协作性目录/ home/shared,使之具有下面的特性: /home/shared 所属组为sharegrp
这个目录对组sharegrp的成员具有可读、可写和可执行,但是不是对其他任何用户。(root可以访问系统上所有文件和目录)
在/home/shared下创建的任何文件所属组自动设置为sharegrp mkdir /home/shared ll–d /home/shared
chgrpsharegrp /home/shared chmodg+w /home/shared chmod o-rx /home/shared chmodg+s /home/shared
7.从ftp://instructor.example.com/pub/updates安装合适的内核更新。下面的要求必须满足: 更新的内核作为系统启动的默认内核
原来的内核在系统启动的时候任然有效和可引导 yum –y installlftp lftp instructor mget *.rpm uname -r
rpm–ivh *.rpm
vim /boot/grub/grub.conf
8.系统instructor.example.com提供了一个LDAP验证服务,你的系统应该按下面的要求绑定到这个服务:
验证服务的基准DN是dc=example,dc=com LDAP用于提供账户信息和验证信息
连接应该使用位置ftp://instructor.example.com/pub/example-ca.crt的证书加密
当正确的配置后,ldapuser11可以登录你的系统,但没有家目录直到你完成autofs题目ldapuser11的密码是’password’ system-config-authentication Id ladpuser11
9.配置你的系统使它是instructor.example.com的一个NTP用户 system-config-date instructor.example.com
10.配置autofs自动挂载LDAP用户的家目录,如下要求:
Instructor.example.com(192.168.0.254)使用NFS共享了/home/guests给你的系统,这个文件系统包含了预先设置好的用户ldapuser11的家目录
Ldapuser11的家目录是instructor.example.com/home/guests/ldapuser11 Ldapuser11的家目录应该自动挂载到本地/home/guests下面的/ldapuser11 家目录必须对用户具有可写权限 Ldapuser11的密码是’passwd’ 自动挂载
vim /etc/auto.master
/home/guests /etc/auto.ldap :wq
cp /etc/auto.misc /etc/auto.ldap vim /etc/auto.ldap
ldapuaer11 –fstype=nfs,rw 192.168.0.254:/home/guests/ldapuser11 :wq
serviceautofs restart su– ldapuser11
11.为server11.example.com实施ftp服务,允许anonymous从/var/ftp/pub下载文件
yum install vsftpd–y servicevsftpd restart chkconfigvsftpd on
12.为站点http://server11.example.com实施一个web服务,然后完成下面的步骤要求:
下载ftp://instructor.example.com/pub/rhcsa/station.html 重命名下载下来的文件为index.html
复制index.html到web服务的DocumentRoot目录 不要对index.html的内容作任何修改 yum install httpd–y lftp instructor get station.html
cp station.html /var/www/html/index.html servicehttpd restart chkconfighttpd on
13.创建一个用户jean,uid为3895。这个用户的密码为nimsdreg。
useradd–u 3895 jean
echoredhat |passwd–stdin jean
14.为你的系统上额外添加一个大小为750M的交换分区,这个交换分区在系统启动的时候应
该能自动挂载,不要移除和更改你系统上现存的交换分区。 swapon -s
fdisk–cu /dev/sda n e l t 82
partx–a /dev/sda ll /dev/sda*
mkswap /dev/sdaX swapon /dev.sdaX vim /etc/fstab
/dev/sdax swapswap defaults 0 0 :wq
mount–a swapon–s
15.找出所有所有者是natasha的文件,并把他们拷贝到/root/found目录。
mkdir /root/found
find / -usernatasha–exec cp–rf {} /root/found/ \\;
16.在档案/usr/share/dict/words内找出所有包含字串strato的列,然后把这些列依照原来的
次序,拷贝到/root/lines.txt内,此档内不存在空行,所有拷贝过来的行列,其内容应跟原文一样
grepstrato /usr/share/dict/words > /root/lines.txt
17.创建一个逻辑组为wgroup,逻辑卷名为wshare,逻辑卷大小为10extent,每个extent为
8Mib,并且挂载到/mnt/wshare,开机有效,使用vfat格式化这个新的逻辑卷
fdisk–cu /dev/sda
n +100M (8*10) t 8e w partx–a /dev/sda pvcreate /dev/sdaX
vgcreatewgroup–s 8M /dev/sdaX vgdisplay PE大小为8M
lvcreate–l 10 –n wsharewgroup mkfs.vfat /dev/wgroup/wshare mkdir /mnt/wshare
mount /dev/wgroup/wshare /mnt/wshare df–TH
vim /etc/fstab
/dev/wgroup/wshaer /mnt/wshaervfatdeatults 0 0 :wq
mount -a