rhce6考题解答

上传人:艾力 文档编号:30676431 上传时间:2018-01-31 格式:DOC 页数:10 大小:414.50KB
返回 下载 相关 举报
rhce6考题解答_第1页
第1页 / 共10页
rhce6考题解答_第2页
第2页 / 共10页
rhce6考题解答_第3页
第3页 / 共10页
rhce6考题解答_第4页
第4页 / 共10页
rhce6考题解答_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《rhce6考题解答》由会员分享,可在线阅读,更多相关《rhce6考题解答(10页珍藏版)》请在金锄头文库上搜索。

1、RHCSA 考试题:1、配置好你的主机名,IP 地址,网关,DNS主机名:IP:172.24.40.40/24网关:172.24.40.1DNS:172.24.40.1直接编辑配置文件或者使用 setup 配置网络,过程如下:先改密码,在 grub 启动时候,按 Esc 键中断启动,按 e 键,然后选择 kernel 那行,按 e 键,然后敲空格,键入 single,然后回车,敲 b 启动进入单用户。#getenforce#setenforce 0#getenforce#passwd修改密码#setenforce 1#getenforce#reboot重启系统进入系统进入系统后,先关掉 Net

2、workManagervi /etc/sysconfig/network-script/ifcfg-eth0把 NW_CONTROLLED=yes注销掉service NetworkManager statusservice NetworkManager stopchkconfig NetworkManager offsetup 修改 IP,掩码,网关,DNS一般 setup 中添加 DNS 后,重启网络服务,DNS 会写入/etc/resolv.conf如果没写入,则编辑vi /etc/resolv.conf 修改 DNS,格式为nameserver 172.24.40.1vi /etc/h

3、osts 修改里面的主机名,格式为172.24.40.40 vi /etc/sysconfig/network 修改主机名,格式为NETWORKING=yesHOSTNAME=2、添加 3 个用户,用户 harry、natasha 、tom,要求 harry、natasha 用户的附加组为 admin组,tom 用户的登陆 shell 为非交互式 shell。useradd harry; passwd harryuseradd natasha; passwd natatshauseradd tom; passwd tomgroupadd adminusermod -a -G admin har

4、ryusermod -a -G admin natashausermod -s /sbin/nologin tom3、在/home 下创建一个目录,名为 admins,要求所属组为 admin 组,组成员可以读写,其它用户没有任何权限,同组成员在目录下创建的文件的所属组也为 admin 组。mkdir /home/admins; cd /homechgrp admin adminschmod -R 770 adminschmod g+s admins4、配置任务计划每天的 14:23 分,执行 echo hello 命令。crontab -e23 14 * * * /bin/echo hell

5、o5、找出 harry 拥有的文件,拷贝到目录/opt/dir 下。mkdir /opt/dirfind / -user harry -exec cp -a /opt/dir ;6、从文件/etc/testfile 中找出包含 abcde 的行,写入到文件 /tmp/testfile 中,要求顺序与/etc/testfile 中一致。cat /etc/testfile |grep abcde /tmp/testfile7、创建一个 2G 的交换分区,并开机自动生效,但不影响原有的 swap 分区。fdisk分区类型选 swap过程略,此处例为/dev/sdb1,大小为 500Mmkswap /

6、dev/sdb1swapon /dev/sdb1echo swapon /dev/sdb1 /etc/rc.local8、创建一个用户 alex,用户 ID 为 1234,用户密码为 alex111。useradd -u 1234 alexecho alex111 |passwd -stdin alex9、安装一个 FTP 服务器,要求可以从/var/ftp/pub 目录中匿名下载(需要你配置 yum 指向已经存在的文件服务器) 。vim /etc/yum.repos.d/mybase.repoyum -y install vsftpdservice vsftpd startchkconfig

7、 vsftpd on10、配置一个 HTTP 服务器,通过 http:/ 可以被访问到,发布的页面请从 http:/ip/dir/example.html 下载。yum -y install httpdcd /var/www/htmlwget http:/ip/dir/example.htmlmv example.html index.htmlservice httpd startchkconfig httpd on11、配置你的主机账号和密码验证方式为 LDAP 方式,通过 ldapuser40 可以登录成功,ldapuser40 密码为:password。证书可以从下载:http:/ip/

8、dir/ldap.crt,用户登录后是没有宿主目录的,除非你配置了后续题目中的 autofs。system-config-authentication用户信息与验证都是用 ldap 服务器,服务器信息如考试提供getent passwdsu - zp12、配置 autofs,实现 ldapuser40 登录成功后,有家目录 /rhome/ldapuser40。家目录在172.24.40.10 上被 nfs 共享为:/rhome/ldapuser40 。并且要求,其它的 ldap 用户登录成功后也能正常使用宿主目录。nfs 服务器配置:vim /etc/exportsservice portma

9、p restartservice nfs restartshowmount -e客户端配置:vim /etc/auto.mastervim /etc/auto.ldapservice autofs restart13、配置你的系统时间与 172.24.40.10 同步。system-config-date14、把名为 vo 的逻辑卷容量由 190M 变为 300M,大小浮动范围为 280320(此逻辑卷已经事先挂载) 。mkfs.ext4 /dev/vg02/vomount /dev/vg02/vo /medialvdisplay15、创建一个卷组,16M 为一个 extends,并在其上划分

10、一个 50 个 extends 的逻辑卷 lv,制作成 ext4 文件系统,并开机自动挂载到/mnt/data 下。mkfs.ext4 /dev/vg01/lvvim /etc/fstab16、升级内核为 2.6.36.7.1,设置为系统启动默认内核,并保留旧的内核可用。lftp:/xxx/kernel-2.6.36.7.1.rpmrpm -ivh kernel-2.6.36.7.1.rpmvim /boot/grub/grub.conf修改 default 到新的内核RHCE 考试题(注意配置 selinux):注意:你的 IP,主机名,网关,DNS 已经配置好IP: 172.24.30.5

11、/24主机名:你是域 的成员主机,另一个域是 (172.25.0.0/16 网络)1、请将 selinux 状态设置为 enforcing 状态。setenforce 1vim /etc/sysconfig/selinux2、请将 ip_forward 功能打开,并永久生效vim /etc/sysctl.confsysctl -p3、配置 ssh 允许 harry 用户访问,拒绝 域访问service sshd startchkconfig sshd oniptables -A INPUT -s 172.25.0.0/16 -p tcp -dport 22 -j REJECT4、配置 ft

12、p 允许匿名从/var/ftp/pub 目录中下载,拒绝 域访问。service vsftpd startchkconfig vsftpd oniptables -A INPUT -s 172.25.0.0/16 -p tcp -dport 20:21 -j REJECT5、将/root/cdrom.iso 关在到/opt/data 下,并设置为开机自动挂载。mount -o loop /root/cdrom.iso /opt/datavim /etc/fstab/root/cdrom.iso /opt/data iso9660 loop,ro 0 06、配置 web 服务器,能被 http

13、:/ 访问。service httpd startchkconfig httpd on7、配置 web 服务器,实现虚拟主机。 http:/ 能访问到/www/virtual 目录下的页面,页面从 http:/ip/dir/example.html 下载。并保证,http:/ 同样能被访问到之前的内容。mkdir -p /www/virtualchcon -t httpd_sys_content_t /wwwchcon -t httpd_sys_content_t /www/virtualcd /www/virtualwget http:/ip/dir/example.htmlmv examp

14、le.html index.htmlvim /etc/httpd/conf/httpd.confservice httpd restartelinks http:/elinks http:/8、从 http:/ip/dir/restircted.html 下载文件,能被本地用户 harry 通过路径http:/ 访问到,但是不可以被 域访问。mkdir /var/www/html/restrictedcd /var/www/html/restrictedwget http:/ip/dir/restricted.htmlmv restricted.html index.htmlservice

15、httpd restartiptables -A INPUT -s 172.25.0.0/16 -p tcp -dport 22 -j REJECT9、配置 nfs 服务器,将/common 目录共享给 域,并允许客户端以root 用户访问时,也拥有 root 用户权限。假设 为 192.168.0.0/16vim /etc/exportsservice nfs restartchkconfig nfs on10、配置 samba 服务器,将/common 共享,能被浏览到。用户 harry 对此共享只读,如果需要,harry 用户密码为 harryuser。yum install sambaservice smb start

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号