检查 reboot df–TH uname–r
links http://server11.example.com ftpinstruator
匿名登录(yum –y install ftp) crontab–u natasha -l
RHCE 部分
1. 设定Selinux为enforcing
getenforce
vim /etc/sysconfig/selinux SELINUX = enforcing setenforce 1
2. 假设FTP伺服器,要求可以让匿名用户访问,要求natasha用户可以访问自己的家目录,要求来自于example.com域的成员可以访问伺服器,其他的不可以访问。
iptables–F
serviceiptables save iptables–L
iptables–A INPUT –s 172.25.0.0/24 –j REJECT iptables–L
serviceiptables save
vi /etc/yum.repos.d/base.repo yum list
yum install vsftpd–y yum install ftp -y servicevsftpd restart chkconfigvsftpd on ftplocalhost
getsebool–a |grep ftp
setsebool–P ftp_home_dir on
3. Harry不能使用cron,这个限制不能影响其他任何用户
vim /etc/cron.deny harry :wq
4. 设置SMB共用,共用目录为/shared
您的SMB伺服器须设定为manager群组的成员 共用名称为shared
Shared可以被browseable
要求只能给来自于example.com域的主机访问 只允许natasha用户访问
mkdir /shared
yum install samba –y
vim /etc/samba/smb.conf /workgroup
workgroup = manager [shared]
path = /shared browseable = yes
valid users = Natasha :wq
servicesmb restart chkconfigsmb on
测试:
添加samba用户: smbpasswd–a natasha 查询samba用户:pdbedit–L
TEST: smbclient //server11.example.com/shared –U Natasha
sealer–a /var/log/audit/audit.log
chcon–t samba_share_t /shared/
setsebool–P allow_polyinstantiation 1 setsebool–P samba_export_all_rw 1
5. 建立http伺服器,要求功能变数名称为serverX.example.com 下载ftp://instructor.example.com/pub/rhce/station.html
重命名为index.html放到默认的DocumentRoot里面,修改档内容为serverX.example.com作为默认网页
要求只有example.com域的成员可以访问serverX.example.com站点
yum install httpd–y lftp instructor get station.html
cp station.html /var/www/html/index.html servicehttpdrestart chkconfighttpd on
links http://server11.example.com
6. 配置一个NFS输出,通过NFS只向example.com域共用您的/shared目录。
vim /etc/exports
/shared *(rw,sync) :wq
servicenfs restart
shkconfignfs on
showmount–e 192.168.0.111
7. 配置你的系统以提供SMTP邮件服务,要满足下面的要求:
你的邮件服务应该能接收来自远程主机和本地的邮件harry必须能够从远程主机收取到邮件
投递给harry的邮件应该放在harry默认的邮箱,/var/spool/mail/harry
yum install postfix -y vim /etc/postficx/mai.cf
75 myhostname = server11.example.com 83 mydomain = domain11.example.com 99 myorigin = $mydomain 116 inet_interfaces = all
164 mydestination = $myhostname,$mydomain,localhost :wq
service postfix restart chkconfig postfix on
8. 配置代名alias对你的MTA,所有发给admin的邮件全部被本地的natasha接受
vim /etc/aliaes admin: natasha :wq
newaliaes
mail–s “test mail”admin@server11.example.com hello . EOT
mail–u natasha
9. 虚拟主机
建立虚拟网站,网址为http://wwwX.example.com. X 是您的工作站编号,并设定: -DocumentRoot为/var/www/html/wwwX
-下载ftp://instructor.example.com/pub/rhce/www.html -将档案重新命名为index.html
-将档案复制到您的虚拟月台的DocumentRoot -切勿更动index.html档案的内容
注意:原来的网站http://serverX.example.com必须依然可以存取,serverX.example.com的
DNS伺服器已提供了wwwX.example.com的名称解析
Vim /etc /httpd/conf/httpd.conf 990 NameVirtualHost *:80
DocumentRoot /var/www/html ServerName server11.example.com
DocumentRoot /var/www/html/www11 ServerName www11.example.com
mkdir /var/www/html/www11 lftp instructor getwww.html
cpwww.html /var/www/html/www11/index.html servicehttpd restart chkconfighttpd on
linkshttp://server11.esxmple.com linkshttp://www11.example.com
10. 设置网页浏览限制,要求只有本地用户可以访问serverX.example.com
vim/etc/httpd/conf/httpd.conf
suthuserfile /etc/http/passwd require valid-user :wq
cut–d: -f1-2 /etc/shadow > /etc/http/passwd servicehttpd restart chkconfighttpd on
links http://server11.example.com
设置网页浏览限制,要求只有本机可以访问wwwX.example.com
allow from www11.example.com allow from server11.example.com