制作习题rhce模拟练习_第1页
制作习题rhce模拟练习_第2页
制作习题rhce模拟练习_第3页
制作习题rhce模拟练习_第4页
制作习题rhce模拟练习_第5页
已阅读5页,还剩36页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

RHCEv2.0::YUM: #rht-vmctlrestartall sshroot@server0-X[root@server0~]#getensshroot@desktop0-X[root@desktop0~]#geten如果selinuxvim/etc/selinux/config配置server0和desktop0上的控制,域中的主机因题意可知 配置server0和desktop0配置自定义命令psnew,执行该命令是将执行psAoaliaspsnew="ps-Ao [root@server0~]#vim/etc/profile[root@server0~]#./etc/profile /smb1,共享名smb1,仅允域中主机。samba用户ldapuser1可以,tianyun;desktop0自动挂接环境准备:labnfskrb5setup[root@server0~]yumyinstallsamba [root@server0~]mkdir [root@server0~]#semanagefcontext-a-tsamba_share_t"/smb1(/.*)?"[root@server0~]#restorecon-RFvv/smb1配置放行[root@server0~]#setfacl-mu:ldapuser1:rx/smb1[root@server0~]#vim/etc/samba/smb.confworkgroup=STAFFpath=hostsallow=环境准备:labnfskrb5[root@desktop0~]#yum-yinstall [root@desktop0~]#vim 00[root@desktop0~]#mkdir/mnt/smb1[root@desktop0~]#mount-a 仅允许用户ldapuser1,ldapuser2读写,都为tianyun;desktop0以multiuser方式自动挂接[root@server0~]#setfacl-mu:ldapuser1:rx/smb2[root@server0~]#setfacl-mu:ldapuser2:rwx/smb2[root@server0~]#vim/etc/samba/smb.confpath=validusers=ldapuser1ldapuser2writelist=ldapuser2[root@server0~]systemctlrestartsmbnmb[root@desktop0~]#vim defaults,username=ldapuser2,password=tianyun,multiuser00[root@desktop0~]#mount–a 域中主机;desktop0自动挂载[root@server0~]#vim [root@server0~]#mkdir设置策略[root@desktop0~]#systemctlrestartnfs[root@desktop0~]#vim/etc/fstab defaults00[root@desktop0~]#mount-

[root@server0~]#wget /pub/keytabs/server0.keytab-O[root@server0~]#vim [root@server0~]#mkdir/nfs2[root@server0~]#mkdir[root@server0~]#chown-Rldapuser5:ldapuser5[root@server0~]#vim/etc/sysconfig/nfsFSDARGS="-V4.2"[root@desktop0~]#wget/pub/keytabs/desktop0.keytab-[root@desktop0~]#vimdefaults,sec=krb5p,v4.20[root@desktop0~]#mount-验证方式:sshldapuser5@localhost[root@desktop0~]#sshldapuser5@localhost[ldapuser5@desktop0~]$cd/mnt/nfs2/private/[ldapuser5@desktop0private]$touch1.xserver0:desktop0:[root@server0~]#nm-connection-[root@server0~]#systemctlrestart配置server0端口转发,从/24网段server0端口6666/tcp时,转发到本地的22/tcp[root@server0~]#firewall-config注意重启配置server0和desktop0上的IPv6,使用接口eth0,相互可以通,原IPv4仍然有效server0:20X:ac18::1205/64desktop020X:ac18::120a/64 [root@server0~]#nm-connection-[root@server0~]#systemctlrestart[root@server0~]#yum-yinstall[root@server0~]vim myhostnamemyhostname=myorigin=relayhost=[]inet_interfaces=loopback-mydestinationlocal_transport=error:localmaildeliveryis[root@server0~]#systemctlrestartserver0配置iscsitarget,卷san10,大小为1G,iscsitarget名为.tianyun:server,仅允许de 主机;desktop0配置iscsiinitiator,创[root@server0~]#fdiskn---->p---->1----->----- [root@server0~]#yum-yinstall[root@server0~] [root@server0~]#/>/backstores/blockcreatesan1/>/iscsi /iscsi/iqn.20...n:server/tpg1>acls/ /iscsi/iqn.20...n:server/tpg1>luns/create/iscsi/iqn.20...n:server/tpg1>portals/create/iscsi/iqn.20...n:server/tpg1>配置[root@desktop0~]#yum-yinstalliscsi*[root@desktop0~]#vim/etc/iscsi/initiatorname.iscsi [root@desktop0~]#iscsiadm--modediscoverydb--typesendtargets--portalserver0-- 重启服务以挂接[root@desktop0~]#partprobe[root@desktop0~]#mkfs.ext4/dev/sda1[root@desktop0~]#mkdir _netdev00[root@desktop0~]#mount–a配置server0Web服务, 。域。网页文件: /content/exam/webs/注:命名为index.,勿修改网页内容因为考试环境没有b文件,从主机进行[root@foundation0Desktop]#scp- RHCE/webs/[root@server0~]#yum-yinstall[root@server0~]yumyinstallmod_sslmod_wsgi[root@server0~]#systemctlenablehttpd[root@server0~]#systemctlstarthttpd设置策略[root@server0~]#cd/etc/httpd/conf.d/[root@server0conf.d]#vim <Directory"/var/www/html">AllowOverrideNoneRequireallRequirenotip<VirtualHostRoot/var/www/html部署文件[root@server0~]#cp [root@server0conf.d]#systemctlrestart测试配置server0Web服务, TLSprivatekeyTLSCA [root@server0conf.d]#mkdirtls[root@server0conf.d]#cdtls/[root@server0tls]#pwd:wgetwgetwget[root@server0conf.d]# <DirectoryAllowOverrideRequireallRequirenotip<VirtualHostRoot/var/www/htmlSSLEngineonSSLProtocolall-SSLv2SSLCipherSuiteSSLHonorCipherOrder File KeyFile ChainFile/etc/httpd/conf.d/tls/example-[root@server0conf.d]#systemctlrestarthttpdwget 配置server0Web服务, ,为网页文件: /pub/webs/server.html [root@server0conf.d]#mkdir[root@server0conf.d]#cp/root/webs/server.html[root@server0conf.d]#cp .confs [root@server0conf.d]#vims <Directory"/var/www/virtual">AllowOverrideNoneRequireallgranted<VirtualHostRoot/var/www/virtualServerNames[root@server0conf.d]#systemctlrestart配置server0Web服务, ,端口为Pythonapplication /content/exam/webs/webapp.wsgi创建 ,部署默认文档[root@server0conf.d]#mkdir[root@server0conf.d]#cp/root/webs/*.wsgi[root@server0conf.d]#cps [root@server0conf.d]#vim Listen<Directory"/var/www/webapp">AllowOverrideNoneRequireall<VirtualHostRoot/var/www/webappServerNamewWSGIScriptAlias/[root@server0conf.d]#journalctl更改selinux[root@server0conf.d]#semanageport-a-thttp_port_t-ptcp8888[root@server0conf.d]#systemctlrestarthttpd设置允许8888端口通讯配置server0Web服务,http://s 网页文件: /content/exam/webs/private.html[root@server0conf.d]#mkdir[root@server0conf.d]#cp/root/webs/private.html/var/www/virtual/private/index.html[root@server0conf.d]#restorecon-RF/var/www/修改 .conf文<Directory AllowOverride Require<DirectoryAllowOverrideNoneRequireallgranted<VirtualHostRoot/var/www/virtualServerNames[root@server0conf.d]#systemctlrestart在本地在desktop0问配置server0S 执行/root/script1.shfoo,输出bar执行/root/script1.shbar输出if[$#-eq0if[$#-eq0echo"Usage/root/script1.shif[$1=="foo"echoelif[$1=="bar"echoecho"Usage/root/script1.sh配置server0 script: [root@server0~]#vimif[$#-eq0-o!-e$1echo"error:Lackofuserfiles"exit2foriin$(cat$1)useradd-s/bin/falseecho"user$iAdded配置server0Mariadb安装配置root户只能从本地登录,为禁用用创建数据库导入数据到 /content/exam/mariadb/mariadb.dumpLuigi用户可以从本地以select方式数据库Concats中的表,tianyun[root@server0~]#yum-ygroupinstallmariadb[root@server0~]#/usr/bin/mysql_secure_installation:/usr/bin/mysql_secure_installation:line379::commandnotNOTE:RUNNINGALLPARTSOFTHISSCRIPTMENDEDFORALLSERVERSINPRODUCTION PLEASEREADEACHSTEPInordertologintoMariaDBtosecureit,we'llneedthepasswordfortherootuser. Ifyou'vejustinstalledMariaDB,andyouhaven'tsettherootpasswordyet,thepasswordwillbeblank,soyoushouldjustpressenterEntercurrentpasswordforroot(enterfornone):OK,successfullyusedpassword,movingon...SettingtherootpasswordensuresthatnobodycanlogintotheMariaDBrootuserwithouttheproperauthorisation.Setrootpassword?[Y/n]yNewpassword:Re-enternewpassword:Passwordupdatedsuccessfully!Reloadingprivilegetables.....Bydefault,aMariaDBinstallationhasananonymoususer,allowinganyonetologintoMariaDBwithouthavingtohaveauseraccountcreatedfor Thisisintendedonlyfortesting,andtomaketheinstallationgoabitsmoother. Youshouldremovethembeforemovingintoaproductionenvironment.Removeanonymoususers?[Y/n]...Normally,rootshouldonlybeallowedtoconnectfrom'localhost'. ensuresthatsomeonecannotguessattherootpasswordfromthenetwork.Disallowrootlog

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论