RHCE 题目及答案 1、 对 sshd 做访问控制, 要求只能来自 ex ample.com 域的用户可以访问你的 ssh 服务器,其他的不可以访问 步骤: rpm –qa |grep openssh vi /etc/hosts.deny >sshd: 192.168.1. wq service sshd restart chkconfig sshd on 或者 iptables -F iptables –A INPUT –s ! 192.168.0.0/24 –p tcp –dport 22 –j REJECT iptables –A INPUT –s ! 192.168.0.0/24 –p udp –dport 22 –j REJECT service iptables save service iptables restart 2、 开启 pop3 服务,要求来自 ex ample.com 域的主机上的用户 tom可以收取你的 pop3 服务器上 tom 的 mail。来自于.cracker.org 的成员不可以访问你的 pop3 服务器 步骤; yum install sendmail* yum install dovecot* chkconfig sendmail on chkconfig dovecot on service sendmail start service dovecot start cd /etc/mail vi local-host-names >example.com stationX.example.com wq vi sendmail.mc > wq m4 sendmail.mc > sendmail.cf vi access >192.168.0 RELAY 192.168.1 REJECT wq makemap hash access.db < access vi /etc/dovecot.conf >#protocols = imap imaps pop3 pop3s 去掉# wq service sendmail restart serv ice dov ecot restart 测试:su – jack mail tom@stationX.ex ample.com ex it mail –u tom ssh –l test 192.168.1.254 mu tt –f imaps://jack@stationX.ex ample.com 输“o”,输密码,发邮件 ex it mail –u tom mailstats 3、 架设 FTP 服务器,要求可以让匿名用户访问。要求 mary 用户可以访问自己的家目录,要求来自于 example.com 域的成员可以访问服务器,其他的不可以访问。 步骤: y u m install v sftpd* chkconfig v sftpd on serv ice v sftpd restart v i /etc/hosts.deny >sshd,v sftpd: 192.168.1. 或者 iptables –A INPUT –s ! 192.168.0.0/24 –p tcp --dport 21 –j REJECT iptables –A INPUT –s ! 192.168.0.0/24 –p u dp --dport 21 –j REJECT iptables –A INPUT –s ! 192.168.0.0/24 –p tcp –dport 20 –j REJECT iptables –A INPUT –s ! 192.168.0.0/24 –p...