RHCSA RHCE70全真考试模拟题结合答案版.docx

上传人:b****8 文档编号:9323463 上传时间:2023-02-04 格式:DOCX 页数:54 大小:108.56KB
下载 相关 举报
RHCSA RHCE70全真考试模拟题结合答案版.docx_第1页
第1页 / 共54页
RHCSA RHCE70全真考试模拟题结合答案版.docx_第2页
第2页 / 共54页
RHCSA RHCE70全真考试模拟题结合答案版.docx_第3页
第3页 / 共54页
RHCSA RHCE70全真考试模拟题结合答案版.docx_第4页
第4页 / 共54页
RHCSA RHCE70全真考试模拟题结合答案版.docx_第5页
第5页 / 共54页
点击查看更多>>
下载资源
资源描述

RHCSA RHCE70全真考试模拟题结合答案版.docx

《RHCSA RHCE70全真考试模拟题结合答案版.docx》由会员分享,可在线阅读,更多相关《RHCSA RHCE70全真考试模拟题结合答案版.docx(54页珍藏版)》请在冰豆网上搜索。

RHCSA RHCE70全真考试模拟题结合答案版.docx

RHCSARHCE70全真考试模拟题结合答案版

注意事项:

1.所有的光盘中的软件包已经在http:

//classroom.domainX下

2.升级软件包已经在http:

//classroom.domainX下

3.你可以用宿主机来验证虚拟机中的考试实验是否正确完成

4.考题中出现的X,是你宿主机的IP地址主机位

域所在的网络是172.24.0.0/16,domainX域所在的网络是172.24.X.0/24,域所在的网络是172.17.0.0/16,一般在题意中被要求拒绝的网络

6.RHCSA部分,在system1主机上完成,RHCE部分,在system1和system2上完成

7.虚拟机管理命令

a)启动虚拟机:

rht-vmcontrolstartsystem1|system2

b)还原虚拟机:

rht-vmcontrolresetsystem1|system2

c)安装虚拟机:

rht-vmcontrolinstallsystem1|system2

d)停止虚拟机:

rht-vmcontrolstopsystem1|system2

8.模考中,上午的主机做完题目,继续在上面完成下午的考题,正式考试,下午的主机是全新安装的

RHCSA模拟题

一、破解system1的root口令

System1的密码已被篡改,将system1的密码修改为redhat

确保System1能被正常登陆

步骤1:

重启虚拟机,编辑启动项(按e编辑)

步骤2:

重启系统

ctrl+x

步骤3:

重新挂载并变更sysroot

switch_root:

/#mount–oremount,rw/sysroot/

switch_root:

/#chroot/sysroot/

sh-4.2#

步骤4:

修改root口令

sh-4.2#passwdroot

Newpassword:

redhat

Retypenewpassword:

redhat

sh-4.2#touch/.autorelabel

步骤5:

再次重启

sh-4.2#exit

switch_root:

/#exit

二、配置主机名,ip地址,网关,DNS,保证System1和System2是用静态IPv4

配置

Sysmte1的参数设置:

主机名:

system1.domainX

IP:

172.24.X.2/24

网关:

172.24.X.254

DNS:

172.24.X.254

System2的参数设置

主机名:

system1.domainX

IP:

172.24.X.2/24

网关:

172.24.X.254

DNS:

172.24.X.254

步骤1:

配置主机名

system1

[root@localhost~]#hostname

Localhost.localdomain

[root@system1~]#hostnamectlset-hostname[root@system1~]#hostname

system2

[root@system2~]#hostname

[root@system2~]#hostnamectlset-hostname[root@system2~]#hostname

步骤2:

配置IP地址

[root@system1~]#nmclicon

NAMEUUIDTYPEDEVICE

Systemeth05fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03802-3-etherneteth0[root@system1~]#nmcliconnmod'Systemeth0'ipv4.addresses"172.24.1.2/24

172.24.1.254"ipv4.dns172.24.1.254

[root@system1~]#nmcliconnmod'Systemeth0'ipv4.methodmanual[root@system1~]#nmcliconnmod'Systemeth0'connection.autoconnectyes[root@system1~]#nmcliconnup'Systemeth0'

Connectionsuccessfullyactivated(D-Busactivepath:

/org/freedesktop/NetworkManager/ActiveConnection/1)

[root@system2~]#nmcliconn

NAMEUUIDTYPEDEVICE

Systemeth05fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03802-3-etherneteth0[root@system2~]#nmcliconnmod'Systemeth0'ipv4.addresses"172.24.1.3/24

172.24.1.254"ipv4.dns172.24.1.254ipv4.methodmanual

connection.autoconnectyes

[root@system2~]#nmcliconnup'Systemeth0'

Connectionsuccessfullyactivated(D-Busactivepath:

/org/freedesktop/NetworkManager/ActiveConnection/1)

con-name–连接名

type–设备类型

ifname–接口名

三、配置SELinux

配置System1的SELinux为enforcing(永久生效)

步骤1:

修改selinux的配置文件

[root@system1~]#vi/etc/selinux/config

SELINUX=enforcing

[root@system2~]#vi/etc/selinux/config

SELINUX=enforcing

步骤2:

重启系统

[root@system1~]#systemctlreboot

[root@system2~]#systemctlreboot

步骤3:

确认selinux状态

[root@system1~]#getenforce

Enforcing

[root@system2~]#getenforce

Enforcing

四、配置yum

为您的系统配置一个默认的软件库

一个YUM源已经提供了在:

http:

//classroom.domainX

配置你的系统,并且yum能正常使用。

步骤1:

配置yum源

[root@system1~]#vi/etc/yum.repos.d/exam.repo

[Packages]

name=Packages

baseurl=

enable=1

gpgcheck=0

步骤2:

查看yum设置

[root@system1~]#yumrepolistall–看到仓库状态enabled

五、调整逻辑卷的大小(LVM)

系统中的home已经被挂载

将此分区调整为300M

不能破坏原有的数据

方法一:

[root@system1~]#lvextend-L300M/dev/vgsrv/home[root@system1~]#resize2fs/dev/vgsrv/home

方法二:

[root@system1~]#lvextend-L300M-rf/dev/vgsrv/home

六、创建用户账号

创建下列的用户、组和组成员关系

创建名字为adminuser的组

用户natasha,使用adminuser作为附属组

用户harry,也使用adminuser作为附属组

用户sarah,在系统中不能访问可交互的SHELL,且不是adminuser的成员,natasha,harry,sarah密码都是redhat

步骤1:

创建用户和组

[root@system1~]#groupaddadminuser

[root@system1~]#useradd-Gadminuserharry[root@system1~]#useradd-Gadminusernatasha[root@system1~]#useradd-s/sbin/nologinsarah

步骤2:

设置用户密码

[root@system1~]#echo'redhat'|passwd--stdinharry[root@system1~]#echo'redhat'|passwd--stdinnatasha[root@system1~]#echo'redhat'|passwd--stdinsarah

或者使用

[root@system1~]#passwdharry

[root@system1~]#passwdnatasha

[root@system1~]#passwdtommy

七、配置文件权限(FACL)

复制文件/etc/fstab到/tmp/fstab,配置/tmp/fstab的权限如下:

文件/tmp/fstab所有者是root

文件/tmp/fstab属于root组

文件/tmp/fstab不能被任何用户执行

用户natasha可读/tmp/fstab

用户harry可读写/tmp/fstab

所有其他用户对/tmp/fstab没有任何权限

步骤1:

设置文件的FACLchownroot:

root/tmp/fstab

[root@system1~]#cp/etc/fstab/tmp/

[root@system1~]#setfacl-muser:

harry:

rw/tmp/fstab

[root@system1~]#setfacl-muser:

natasha:

r/tmp/fstab

[root@system1~]#setfacl-mother:

:

-/tmp/fstab

步骤2:

验证

[root@system1~]#getfacl/tmp/fstab

getfacl:

Removingleading'/'fromabsolutepathnames

#file:

tmp/fstab

#owner:

root

#group:

root

user:

:

rw-

user:

harry:

rw-

user:

natasha:

r--

group:

:

r--

mask:

:

rw-

other:

:

---

八、配置一个cron任务

用户harry配置一个cronjob,当地时间每天14:

23运行,执行/bin/echohello

创建任务

[root@system1~]#crontab-e-uharry

2314***/bin/echohello

查看任务

[root@system1~]#crontab-l-uharry

九、管理目录权限

创建一个目录/home/admins,使之具有下面的特性

目录/home/admins所属组为adminuser

这个目录对组adminuser的成员有具有可读、可写和可执行权限

在/home/admins创建的任何文件所属组自动设置为adminuser

步骤1:

创建目录

[root@system1~]#mkdir/home/admins

步骤2:

修改目录的属性

[root@system1~]#chown:

adminuser/home/admins

[root@system1~]#chmod2770/home/admins

步骤3:

验证

[root@system1~]#ls-ld/home/admins/

drwxrws---.2rootadminuser1024Sep1702:

54/home/admins/

十、绑定到外部验证服务器

配置系统使用ldap认证,口令使用LADP服务器的认证口令

ldap域名:

dc=example,dc=com

ldap服务器:

ldap证书:

用户ldapuserX登录后,没有家目录信息,除非配置了后续的autofs

步骤1:

安装需要的软件

[root@system1~]#yum-yinstallopenldap-clientssssdauthconfig-gtkkrb5-workstation

步骤2:

加入LDAP

[root@system1~]#system-config-authentication

十一、配置NTP

1.配置主机和classroom.domainX迚行时钟同步

步骤1:

system1

[root@system1~]#echo"serveriburst">>/etc/chrony.conf

[root@system1~]#systemctlrestartchronyd.service

[root@system1~]#systemctlenablechronyd.service

十二、配置autofs

配置autofs自动挂在LDAP用户的家目录,如下要求

已经使用NFS共享了home给你的系统。

这个文件系统包含了预先配置好的用户ldapuserX的home目录

ldapuserX的home目录是:

ldapuserX的home目录能自动挂载到本地/home/guests下面的ldapuserX

home目录必须对用户具有可写权限

ldapuserX的密码是redhat

步骤1:

修改配置文件

[root@system1~]#vim/etc/auto.master.d/home.autofs

/home/guests/etc/auto.home(指定子配置文件)

[root@system1~]#vim/etc/auto.home

*:

/home/guests/&(*代表和&对应的任意目录)

步骤2:

启动autofs服务

[root@system1~]#systemctlstartautofs

[root@system1~]#systemctlenableautofs

十三、添加一个swap分区

为你的系统额外添加一个大小为750M的交换分区

这个交换分区在系统启动的时候应该能自动挂载

不要移除和修改你系统上现有的交换分区

步骤1:

创建一个新的分区

[root@system1~]#fdisk/dev/vda

Welcometofdisk(util-linux2.23.2).

Changeswillremaininmemoryonly,untilyoudecidetowritethem.

Becarefulbeforeusingthewritecommand.

Command(mforhelp):

p

Disk/dev/vda:

32.2GB,32212254720bytes,62914560sectors

Units=sectorsof1*512=512bytes

Sectorsize(logical/physical):

512bytes/512bytes

I/Osize(minimum/optimal):

512bytes/512bytes

Disklabeltype:

dos

Diskidentifier:

0x0009f9ec

DeviceBootStartEndBlocksIdSystem

/dev/vda1*204841164720480083Linux

/dev/vda241164841379839204840968eLinuxLVM

Command(mforhelp):

n

Partitiontype:

pprimary(2primary,0extended,2free)

eextended

Select(defaultp):

e

Partitionnumber(3,4,default3):

4

Firstsector(41379840-62914559,default41379840):

回车

Usingdefaultvalue41379840

Lastsector,+sectorsor+size{K,M,G}(41379840-62914559,default62914559):

回车

Usingdefaultvalue62914559

Partition4oftypeExtendedandofsize10.3GiBisset

Command(mforhelp):

n

Partitiontype:

pprimary(2primary,1extended,1free)

llogical(numberedfrom5)

Select(defaultp):

l

Addinglogicalpartition5

Firstsector(41381888-62914559,default41381888):

回车

Usingdefaultvalue41381888

Lastsector,+sectorsor+size{K,M,G}(41381888-62914559,default62914559):

+750M

Partition5oftypeLinuxandofsize750MiBisset

Command(mforhelp):

p

Disk/dev/vda:

32.2GB,32212254720bytes,62914560sectors

Units=sectorsof1*512=512bytes

Sectorsize(logical/physical):

512bytes/512bytes

I/Osize(minimum/optimal):

512bytes/512bytes

Disklabeltype:

dos

Diskidentifier:

0x0009f9ec

DeviceBootStartEndBlocksIdSystem

/dev/vda1*204841164720480083Linux

/dev/vda241164841379839204840968eLinuxLVM

/dev/vda44137984062914559107673605Extended

/dev/vda5413818884291788776800083Linux

Command(mforhelp):

t

Partitionnumber(1,2,4,5,default5):

Hexcode(typeLtolistallcodes):

82

Changedtypeofpartition'Linux'to'Linuxswap/Solaris'

Command(mforhelp):

p

Disk/dev/vda:

32.2GB,32212254720bytes,62914560sectors

Units=sectorsof1*512=512bytes

Sectorsize(logical/physical):

512bytes/512bytes

I/Osize(minimum/optimal):

512bytes/512bytes

Disklabeltype:

dos

Diskidentifier:

0x0009f9ec

DeviceBootStartEndBlocksIdSystem

/dev/vda1*204841164720480083Linux

/dev/vda241164841379839204840968eLinuxLVM

/dev/vda44137984062914559107673605Extended

/dev/vda5413818884291788776800082Linuxswap/Solaris

Command(mforhelp):

w

Thepartitiontablehasbeenaltered!

Callingioctl()tore-readpartitiontable.

WARNING:

Re-readingthepartitiontablefailedwitherror16:

Deviceorresourcebusy.

Thekernelstillusestheoldtable.Thenewtablewillbeusedat

thenextrebootorafteryourunpartprobe(8)orkpartx(8)

Syncingdisks.

步骤2:

创建swap

[root@system1~]#partprobe

[root@system1~]#mkswap/dev/vda5

Settingupswapspaceversion1,size=7

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1