chmod 777 /common
getsebool –a | grep samba (查看samba属性)
setsebool –P samba_export_all_ro on (samba的只读属性) common是可浏览 /etc/init.d/smb restart smbpasswd -a barry
roxicant
验证:smbclient //192.168.0.250/common -U barry
8.要求
<配置一个NFS 共享>
只向domainX.example.com 域内通过NFS 输出您的/common 共享目录
注意:因为你没有root 权限来直接挂载虚拟机上共享的/common 目录,但是物理机上的autofs 已经运行,通过下面的目录可以检查你 的NFS 共享是否正常
/net/station.domainX.example.com
yum install rpcbind –y yum install nfs* -y
/etc/init.d/rpcbind restart /etc/init.d/nfs restart chkconfig rpcbind on chkconfig nfs on
vim /etc/exports 添加
/common 172.24.0.0/255.255.255.0(rw,no_root_squash) /etc/init.d/nfs restart
验证: showmount -e 192.168.0.250
9.要求
<配置SSH 访问>
按以下要求配置SSH 访问:
>用户能够通过SSH 远程从域domainX.example.com 内的客户端访问你的机器 >在域my133t.org 内的客户端不能访问你的机器 Service sshd restart
vim /etc/hosts.deny //添加 sshd:ALL EXCEPT 192.168.0.0/255.255.255.0 验证:ssh root@172.24.X.25
10.要求
<实现一个WEB 服务器>
为站点http://station.domainX.example.com 创建一个WEB 服务器,然后执行下述步骤:
下载ftp://rhgls.domainX.example.com/pub/rhce/station.html 文件至默认DocumentRoot 目录下,并将其重命名为
index.html,不要对文件index.html 的内容做任何修改
yum install httpd* -y chkconfig httpd on
/etc/init.d/httpd restart cd /var/www/html
wgetftp://rhgls.domainX.example.com/pub/rhce/station.html mv station.html index.html 验证:yum install lynx -y
lynx 192.168.0.254 或者 火狐浏览器
11.要求
<配置WEB 内容的访问>
在您的WEB 服务器的DocumentRoot 目录下创建一个名未secret 的目录,从 ftp://rhgls.domainX.example.com/pub/rhce/station.html 下载一个文件副本到这个目录,并且重命名未index.html。不要对这
个文件的内容做任何修改。从您的本地主机上,任何都只能从本机浏览secret 的内容
cd /var/www/html mkdir secret cd secret
wgetftp://rhgls.domainX.example.com/pub/rhce/station.html mvstation.html index.html
vim /etc/httpd/conf/httpd.conf //最后一行添加限制:只能从本机浏览secret的内容
验证:火狐或者 lynx http://192.168.0.250/secret
12.要求
<配置虚拟主机>
扩展您的WEB 服务器,为站点http://www.domainX.example.com 创建一个虚拟主机,然后执行下述步骤:
>设置DocumentRoot 为/var/www/virtual
>下载ftp://rhgls.domainX.example.com/pub/rhce/www.html 文件至虚拟主机的DocumentRoot 目录下,不要对文件 index.html 的内容做任何修改
>确保barry 用户能够在/var/www/virtual 目录下创建文件
注意:原始站点http://station.domainX.example.com 必须仍然能够访问,对主机名www.domainX.example.com 的域名解析已经 由名称服务器rhgls.domainX.example.com 提供了
cd /var/www/ mkdir virtual cd virtual
wgetftp://rhgls.domainX.example.com/pub/rhce/www.html mv www.html index.html
setfacl –m u:barry:rwx /var/www/virtual vim /etc/httpd/conf/httpd.conf
注释掉317—346行
990行,去掉“#” NameVirtualHost *:80
DocumentRoot /var/www/html/
ServerName station.domainX.example.com
DocumentRoot /var/www/virtual/
ServerName www.station.domainX.example.com
/etc/init.d/httpd restart 验证:vim /etc/hosts 添加
192.168.0.250 www.station.domainX.example.com
验证:火狐或者 lynx http://www.station.domainX.example.com
13.要求
<创建一个脚本>
创建一个名为/root/script 的脚本,让其提供下列特性: 当运行/root/script foo,输出为bar 当运行/root/script bar,输出为foo
当没有任何参数或者参数不是foo 或者bar 时,其向stderr 产生以下的输出: /root/script foo|bar
cd /root vim script
#! /bin/bash case "$1" in
bar)
echo foo
;;
foo)
echo bar
;;
*)
echo "/root/script foo|bar"
;; esac
chmod a+x script 验证: ./script bar
./script foo ./script abc
14.要求
<挂载一个镜像>
配置您的系统,让系统在启动的时候,将位于/root/cdrom.iso 的文件系统镜像自动挂载到/mnt/discimg 目录下
cd /root
wgetftp://rhgls.domainX.example.com/pub/cdrom.iso vim /etc/fstab
/root/cdrom.iso /mnt/discimg iso9660 loop 0 0 mkdir /mnt/discimg mount -a
验证: df–h
15.要求
<配置启动参数>
修改您的系统,将系统的启动参数sysvctl 设置为1。您的修改应该在/proc/cmdline 文件中可见
vim /etc/grub.conf 在kernel的最后一行rhgb quiet后面添加sysvctl=1重启才能生效 验证: reboot
cat /proc/cmdline
16.<配置一个iSCSI 磁盘>
系统host.domainX.example.com 通过标准端口(3260)提供了一个iSCSI 的块设备。在您的虚拟机上连接此设备,并按以下要求使 用此设备创建一个文件系统:
>在iSCSI 的设备上创建一个大小为1200MiB 的分区,并格式化为ext4。将分区挂载到您的虚拟机上的/mnt/data
>下载ftp://rhgls.domainX.example.com/pub/iscsi.txt 文件的副本至文件系统中,拥有人为root,权限为0644。不要更改文件的 任何内容
>此文件系统在启动时能自动挂载
yum install iscsi* -y
iscsiadm -m discovery -t st -p 172.24.X.254(发现设备,服务器IP) iscsiadm -m discovery -t st -p 172.24.X.254–l (挂载) 查看: ll /dev/sda fdisk –cu /dev/sda ---n--p--w---
mkfs.ext4 /dev/sda1 blkid
vim /etc/fstab
uuid? /mnt/data ext4 defaults 0 0 mkdir /mnt/data mount -a
cd /mnt/data
wgetftp://rhgls.domainX.example.com/pub/iscsi.txt 考试注意事项
?考题为多国语言,在考试期间可以随时切换
?待所有题目做完之后,重启虚拟机,检查至少两到三遍
?确定由于硬件原因引起的无法做题的情况,可联系考官帮助处理
?考试环境中,某些环境跟本套模拟环境有细微差别,例如用户名称,IP 地址之类,这些信息自己在考试时随机应便,考题里会详 细描述
?先挑会的题目,熟练的题目做,不熟的题放在后面做,不要将时间浪费在不会的题目上,考试时会给考生发草稿纸,以方便记录 必要的信息
?所有配置的为系统服务的题,做完之后请务必使用chkconfig 命令将系统服务配置为开机自启动 chkconfig crond on chkconfig vsftpd on chkconfig autofs on chkconfig rpcbind on chkconfig nfs on chkconfig smb on chkconfig httpd on chkconfig iscsi on chkconfig iscsid on chkconfig postfix on chkconfig dovecot on chkconfig iptables on__