RHCSA Exam Practice Question Fill the form with your name / address / email Agree with the rules and accept it * login in runlevel 5 with GUI with root: - change the root password to !"n#da$%& - assign the static ip Ip : $'"&$()&%& + is your station num,er .etmas : "55&"55&"55&% Gateway : $'"&$()&%&$ 0.1 : $'"&$()&%&"52 - 1et the 3ostname station&e4ample&com Ans& rootstation$ 67 rootstation$ 67#echo "V2nCda10" | passwd --stdin root rootstation$ 67 rootstation$ 67#vim /etc/sysconfig/network-scripts/ifcfg-eth0 - & do foowing changes! $%$'"static" (%)**'"1+2,1.,0," $)34'"255,255,255,0" 6ateway'"1+2,1.,0,1" !w7 rootstation$ 678 rootstation$ 678 vim /etc/resov,conf search e8ampe,com nameserver 1+2,1.,0,259 !w7
93#A 9euirements with ;uestions and 1olutions ;&$ : =U> ftp://instructor& ftp://instructor&e4ample&com/pu,/rh e4ample&com/pu,/rhel(/dvd el(/dvd Ans& rootstation$ 678 rootstation$ 678 vim /etc/y:m,repos,d/cient,repo ;Cient< name'y:m cient =ase:r'ftp!//instr:ctor,e8ampe,com/p:=/rhe/dvd gpgcheck'0 !w7 rootstation$ 678 rootstation$ 678 y:m ist a ;&" #reate the following users? groups? and group mem,ership: - A group named sysusers& - A user paula who ,elongs to sysusers as a secondary group& - A user susan who ,elongs to sysusers as a secondary group& - A user ,rad who does not have access to an interactive shell @ who is not a mem,er of sysusers group& - paula? susan and ,rad should all have the password of password& Ans& rootstation$ 678 rootstation$ 678gro:padd sys:sers rootstation$ 678 rootstation$ 678:seradd -6 sys:sers pa:a rootstation$ 678 rootstation$ 678:seradd -6 sys:sers s:san rootstation$ 678 rootstation$ 678:seradd -s /s=in/noogin =rad pa:a & ; 6ive password password of password for pa:a pa:a < rootstation$ 678 rootstation$ 678passwd pa:a & ; 6ive password of password for s:san < rootstation$ 678 rootstation$ 678passwd s:san
rootstation$ 678passwd =rad
& ; 6ive password of password for =rad <
;& create a colla,orative directory /shared/sysusers with the following characteristics: - Group ownership of /shared/sysusers is sysusers& - Bhe directory should ,e reada,le? writa,le? and accessi,le to mem,er of sysusers? ,ut not to any other user& +It is understood that root has access to all files and directories on the system& - Files created in /shared/sysusers automatically have group ownership set to the sysusers group& Ans& rootstation$ 678mkdir -p /shared/sys:sers rootstation$ 678chgrp sys:sers /shared/sys:sers rootstation$ 678chmod 2>>0 /shared/sys:sers ;&2 Install the appropriate ernel update from ftp://server$&e4ample&com/pu,/updates& Bhe following criteria must ,e also ,e met: - Bhe updated ernel is the default ernel when the system is re,ooted& - Bhe original ernel remains availa,le and ,oota,le on the system& Ans& rootstation$ 678ftp server1,e8ampe,com/p:=/:pdates rootstation$ 678ftp server1,e8ampe,com!/p:=/:pdates? get kerne-@$a=? rootstation$ 678ftp server1,e8ampe,com!/p:=/:pdates? =ye A ote! Bo:r ew 6r:= fie ook ike =eow after insta the new kerne
rootstation$ 678rpm -ivh kerne-@$a=? rootstation$ 678vim /=oot/gr:=/gr:=,conf defa:t'0 timeo:t'5 spashimage'Ahd0D0/gr:=/spash,8pm,gE hiddenmen: tite 9ed 3at Cnterprise Dinu4 1erver A2,,F2->1,1,1,e,i. root Ahd0D0 kerne /vmin:E-2,,F2->1,1,1,e,i. ro root'G)G'/ rhg= 7:iet initrd /initrd-2,,F2->1,1,1,e,i.,img tite 9ed 3at Cnterprise Dinu4 1erver A2,,F2->1,e,i. root Ahd0D0 kerne /vmin:E-2,,F2->1,e,i. ro root'G)G'/ rhg= 7:iet initrd /initrd-2,,F2->1,e,i.,img ;&5 1et up the default local print ueue to forward Eo,s to the I +#U1 print ueue station on instructor&e4ample&com? where is your station num,er& #onfigure the printer as a Generic-te4t-only print ueue& Ans& rootstation$ 678system-config-printer --? Cick ew %rinter --? $ype station --? seect ipp A (nternet %rinting %rotoco --? $ype Hostname --? instr:ctor,e8ampe,com --? $ype printername --? station --? seect 6eneric --? $e8t ny %rinter $ype & than cick yo:r station :nder oca printer at the eft hand-side after that cick make defa:t printer ta= at the right hand-side
;&( Bhe user andrew must configure a cron Eo, that runs daily at $5:"5 local time and e4ecutes - /,in/echo hello /dev/tty$ Ans& rootstation$ 678cronta= -: pa:a -e 25 15 I I I /=in/echo heo ??/dev/tty1 rootstation$ 678service crond restartJ chkconfig crond on ;&H #onfigure your machine as D0A client& D0A server and D0A directory tree information will ,e given in the e4am& - ldapuser should ,e a,le to log into your system? where is your station num,er? ,ut will not have a home directory until you have completed the autofs reuirement& - All ldapuser users have a password of password Ans& rootstation$ 678system-config-a:thentication --? n the (dentity & ):thentication ta=D seect Kser )/C Config:ration check =o8D choose G*)% for Kser )/C *ata=ase --? Config:re G*)% 3earch ase * with! dc'e8ampeDdc'com --? Config:re G*)% 3erver with the K(! dap!//instr:ctor,e8ampe,com --? 3eect Kse $G3 to encrypt connections and Cick *ownoad C) Certificate --? nter Certificat KG! http!//instr:ctor,e8ampe,com/p:=/)%G-C)-C$ & cick ok --? na=e G*)% :nder ):thentication Config:ration & Cick )ppy =:tton, rootstation$ 678getent passwd dap:ser ; $o check cient & server mapping < I ow check =y ogging thro:gh dap:ser A3:ppose yo: are sitting at station2 then yo:r :ser wi =e dap:ser2 I the password of dap:ser2 is password ;&) #onfigure autofs to automount the home directories of D0AU1C9 users& .ote the following: - server$&e4ample&com +$'"&$()&%&"52 .F1-e4ports /home/guests for ldapuser? - ldapusers home directory is server$&e4ample&com:/home/guests/ldapuser? where is your station num,er - ldapusers home directory should ,e automounted locally ,eneath /home/guests as /home/guests/ldapuser - home directories must ,e writa,le ,y their users& - while you are a,le to log in as any of the user ldapuser$ through ldapuser"%? the only home directory that is accessi,le from your system is ldapsuser * C4ample: station" would configure the automounter such that ldapuser"s home directory /home/guests/ldapuser" gets mounted automatically upon login& Bhe .F1 share would ,e: - instructor&e4ample&com:/home/guests/ldapuser"& Ans& rootstation$ 678 vim /etc/a:to,master /home/g:ests /etc/a:to,g:ests ote! I A /home/g:ests which is in yo:r system I A /etc/a:to,g:ests this is new fie which we create & we provide the info, to the cient that what is coming from the G*)% 3erver,
rootstation$ 678vim /etc/a:to,g:ests Aor /etc/a:to,misc I -fstype'nfs instr:ctor,e8ampe,com!/home/g:ests/dap:ser rootstation$ 678service a:tofs stop rootstation$ 678service a:tofs startJ chkconfig a:tofs on I ote! ow check ogin thro:gh yo:r dap:ser from the termina & ony yo:r station dap:ser wi get the home directory ;&' #opy the file /etc/fsta, to /var/tmp& #onfigure the permissions of /var/tmp/fsta, so that: - the file /var/tmp/fsta, is owned ,y the root user - the file /var/tmp/fsta, ,elong to the group root - the file /var/tmp/fsta, should not ,e e4ecu,a,le ,y anyone - the user paula is a,le to read and write /var/tmp/fsta, - the user susan can neither write nor read /var/tmp/fsta, - all other users +current or future have the a,ility to read /var/tmp/fsta, Ans& rootstation$ 678cp -p /etc/fsta= /var/tmp rootstation$ 678s - /var/tmp/fsta= I if re7:ired change them rootstation$ 678chown root!root /var/tmp/fsta= rootstation$ 678setfac -m :!pa:a!rw- /var/tmp/fsta= rootstation$ 678setfac -m :!s:san!--- /var/tmp/fsta= ;&$% #onfigure your system so that it is an .B client of server$&e4ample&com& Ans& rootstation$ 678system-config-date --? on *ate and $ime ta= --? seect check =o8 3ynchroniEe date and time over the network I Lirsty remove a e8isting $% servers entry & after that --? than cick )dd =:tton I $ype instr:ctor,e8ampe,com andD I cick show advanced options --? seect check =o8 3peed :p initia 3ynchroniEation --? than cick 4 =:tton A M yo:r system is config:red as a $% Cient ;&$$ #onfigure the FB 1erver for anonymous 0ownload Ans& ; $o (nsta ftp server rpm < rootstation$ 678 y:m insta vsftpd service vsftpd restartJ chkconfig vsftpd on rootstation$ 678 ;&$" =our system has a new $%%>J physical partition mounted under /mnt/new with a $%%>J e4t2 filesystem& .ote: ,ecause partition siKes are seldom e4actly what is specified when they are created? anything within the range of '%>J to $$%>J is accepta,le& ;&$ 9esiKe the lvm to "5%> /home Ans& rootstation$ 678vscan L 3 7 rootstation$ 678:mo:nt /home rootstation$ 678ve8tend --siEe 250 /dev/vg1/v-home rootstation$ 678e2fsck -f /dev/vg1/v-home rootstation$ 678resiEe2fs /dev/vg1/v-home rootstation$ 678mo:nt /dev/vg1/v-home /home
L 3 7 rootstation$ 678:mo:nt /home rootstation$ 678e2fsck -f /dev/vg1/v-home rootstation$ 678resiEe2fs /dev/vg1/v-home 250 rootstation$ 678vred:ce --siEe 250 /dev/vg1/v-home rootstation$ 678mo:nt /dev/vg1/v-home /home ;&$2 9esiKe the D!> using the GUI tool ,y the C value& ;&$5 #reate a swap partition of H5(> >J and mae it availa,le permanent& L attern - $ 7 Ans& rootstation$ 678 fdisk /dev/vda command A m for hep !n ; $o make new partition < Lirst Cyinder! @Geave ank? Gast Cyinder!N>5 command A m for hep !w
; $o save & e8it partition ta=e <
; $o active new partition ta=e < rootstation$ 678re=oot I )fter re=oot r:n foowing command to make swap partition for permanent! ; Mhere is yo:r partiton n:m=er < rootstation$ 678mkswap /dev/vda ; Mhere is yo:r partiton n:m=er < rootstation$ 678swapon /dev/vda ; $o check new swap partition is active or not < rootstation$ 678swapon -s ; $o make swap partition for permanent < rootstation$ 678vim /etc/fsta= /dev/vd swap swap defa:t 0 0 !w7 ; $o save & e8it fsta= fie < L attern - $ 7 rootstation$ 678cd / rootstation$ 678dd if'/dev/Eero of'swapfie =s'>5 co:nt'1 rootstation$ 678mkswap swapfie rootstation$ 678swapon swapfie rootstation$ 678swapon -s ; $o make swap partition for permanent < rootstation$ 678vim /etc/fsta= /swapfie swap swap defa:t 0 0 !w7 ; $o save & e8it fsta= fie <
;&$( #onfigure Internet we, server for your domain& 0ownload the inde4&html from the server +I and location will ,e specified in the e4am into the default document root of the server - 0ownload ftp://instructor&e4ample&com/pu,/rhce/station&html - 9ename the downloaded file to inde4&html - #opy this inde4&html file to the 0ocument9oot of your we, server - 0o .
I than press shift N g A to go nd of the fie @Virt:aHost 1+2,1.,0,!.0? 3erver)dmin rootOstation,e8ampe,com *oc:mentoot /var/www/htm 3erverame station,e8ampe,com *irectory(nde8 inde8,htm @/Virt:aHost?
rootstation$ 678service httpd restartJ chkconfig httpd on rootstation$ 678vim /etc/hosts 1+2,1.,0, station,e8ampe,com station I than save & e8it the fie and check the Me= 3erverD open firefo8 & type :r! station,e8ampe,com * .ode& Ans& 3impy edit itSs config:ration fie set the enfocing mode infront of 3G(K directive ike thatD & to make it permanenet re=oot yo:r system, rootstation$ 678vim /etc/sysconfig/sein:8 3G(K'enforcing !w7 rootstation$ 678init ;&" Cna,le I Forwarding on your machine& Ansrootstation$ 678vim /etc/sysct,conf net,ipv9,ipTforward ' 1 !w7 rootstation$ 678sysct -w
rootstation$ 678sysct -p ;& #onfigure 113 access as follows - susan has remote 113 access to your machine from within e4ample&com - #lients within my$t&org should .
the /shared directory via 1>J: =our 1>J server must ,e a mem,er of the 1>JG9
- Bhe shared share must ,e ,rowsea,le - susan mush have read access to the share? authentication with the same password password? if necessary& Ansrootstation$ 678 mkdir /shared rootstation$ 678chcon - -t sam=aTshareTt /shared rootstation$ 678getse=oo -a |grep sam=a rootstation$ 678setse=oo -% sam=aTena=eThomeTdirs on rootstation$ 678vim /etc/sam=a/sm=,conf workgro:p ' 36K% interface o eth0 1+2,1.,0,12/29 host aow 12>, 1+2,1.,0, ;shared< comment ' shared path ' /shared =rowsea=e ' yes vaid :sers ' s:san !w7 rootstation$ 678/etc/init,d/sm= restartJchkconfig sm= on rootstation$ 678sm=passwd -a s:san ew 3 password!password IIIIII etype new 3 password!password IIIIII rootstation$ 678service sm= restart rootstation$ 678sm=cient -G ocahost - rootstation$ 678sm=cient //1+2,1.,0,12/shared -K s:san nter s:sanSs password! *omain';36K%< 3';Kni8< 3erver';3am=a F,5,9-.,e< sm=! R? ;&H the +I the
#onfigure Internet we, server for your domain& 0ownload the inde4&html from server& and location will ,e specified in the e4am into the default document root of server - 0ownload ftp://instructor&e4ample&com/pu,/rhce/station&html - 9ename the downloaded file to inde4&htmlO> - #opy this inde4&html file to the 0ocument9oot of your we, server - 0o .
Ansrootstation$ 678y:m insta httpd rootstation$ 678cd /var/www/htm rootstation$ 678ftp instr:ctor,e8ampe,com Connected to instr:ctor,e8ampe,com A1+2,1.,0,259, 220 AvsL$%d 2,2,2 ame Ainstr:ctor,e8ampe,com!root! ftp Ahere define :sername ftp FF1 %ease specify the password, A& the ftp :ser password is ftp %assword! 2F0 Gogin s:ccessf:, emote system type is K(, Ksing =inary mode to transfer fies, ftp? cd pu,/rhce Aswitch into rhce directory 250 *irectory s:ccessf:y changed, ftp? get station,htm inde8,htm
ftp?,ye
rootstation$ 678vim /etc/httpd/conf/httpd,conf ameVirt:aHost 1+2,1.,0,1>!.0 Aenter yo:r ip address =efore port .0 # # # # #
Virt:aHost e8ampe! )most any )pache directive may go into a Virt:aHost container, $he first Virt:aHost section is :sed for re7:ests witho:t a known server name,
@Virt:aHost 1+2,1.,0,1>!.0? Aagain enter yo:r ip address =efore port .0 3erver)dmin rootOdesktop1>,e8ampe,com *oc:mentoot /var/www/htm A*efine here yo:r doc:ment root 3erverame desktop1>,e8ampe,com A*efine here yo:r we=site name *irectory(nde8 inde8,htm A*efine here directory inde8 @/Virt:aHost? !w7
rootstation$ 678/etc/init,d/httpd restartJchkconfig httpd on ;&) C4port your /shared directory via .F1 to the e4ample&com domain only: - =ou can chec your shared directory ,ut shoumount will not allow ,ecuse you login from local user - =ou may chec ,y using /net directory Ansrootstation$ 678vim /etc/e8ports /shared I,e8ampe,comArwDsync !w7 rootstation$ 678chkconfig nfs on rootstation$ 678service nfs restart rootstation$ 678cd /net/1+2,1.,0,1> rootstation$ 678 tota 0 dr-8r-8r-8, F root root 0 W: 2. 1+!99 shared ;&' #onfigure an email alias for your >BA such that mail sent to acctmgr is received ,y the local user paula& Ansrootstation$ 678vim /etc/aiases acctmgr! pa:a !w7 rootstation$ 678newaiases ;&$% #onfigure 1>B mail service according to the following reuirements: - =our mail server should accept mail from remote hosts and localhost - susan must ,e a,le to receive mail from remote hosts - >ail delivered to susan should spool into the default mail spool for susan? /var/spool/mail/susan rootstation$ 678y:m insta postfi8 rootstation$ 678vim /etc/postfi8/main,cf myhostname ' desktop1>,e8ampe,com Aset yo:r hostname mydomain ' e8ampe,com Adefine yo:r domain name myorigin ' Xmydomain Aset myorigin inetTinterfaces ' a A:ncomment this ine #inetTinterfaces ' ocahost Acomment this ine
#mydestination ' XmyhostnameD ocahost,XmydomainD ocahost Acomment this ine #mydestination ' XmyhostnameD ocahost,XmydomainD ocahostD Xmydomain mydestination ' XmyhostnameD ocahost,XmydomainD ocahostD Xmydomain A:ncomment this ine mynetworks ' 1+2,1.,0,0/29D 12>,0,0,0/. !w7
rootstation$ 678/etc/init,d/postfi8 restartJchkconfig postfi8 on ;&$$ C4tend your we, server to include a virtual host for the site http://www&e4ample&com? where is your station num,er? then perform the following steps: - 1et the 0ocument9oot to /var/www/virtual - 0ownload ftp://instructor&e4ample&com/pu,/rhce/www&html - 9ename the downloaded file to inde4&htmlO> - lace this inde4&html in the 0ocument9oot of the virtual host - 0o .!.0? 3erver)dmin rootOdesktop1>,e8ampe,com *oc:mentoot /var/www/virt:a A*efine here yo:r doc:ment root 3erverame www1>,e8ampe,com A*efine here yo:r we=site name *irectory(nde8 inde8,htm A*efine here directory inde8 @/Virt:aHost? !w7 rootstation$ 678/etc/init,d/httpd restartJchkconfig httpd on ;&$" ass the ernel argument sysctlP$ to the ernel and mae sure that the argument is availa,le across the re,oot& Ansrootstation$ 678vim /etc/gr:=,conf
defa:t'0 timeo:t'5 spashimage'Ahd0D0/gr:=/spash,8pm,gE hiddenmen: tite ed Hat nterprise Gin:8 3erver A2,,F2->1,e,8.T9,de=:g root Ahd0D0 kerne /vmin:E-2,,F2->1,e,8.T9 ro root'/dev/mapper/vo0-root rdTGVTGV'vo0/root rdTTGK43 rdTT* rdTT* G)6'enTK3,K$L-. 3B3L$'atarcyrhe=-s:n1 4B)*$B%'pc 4B$)G':s crashkerne'a:to sysct'1 rhg= 7:iet initrd /initramfs-2,,F2->1,e,8.T9,img !w7
rootstation$ 678cat /proc/cmdine ro root'/dev/mapper/vo0-root rdTGVTGV'vo0/root rdTTGK43 rdTT* rdTT* G)6'enTK3,K$L-. 3B3L$'atarcyrhe=-s:n1 4B)*$B%'pc 4B$)G':s crashkerne'12+O0 sysct'1 rhg= 7:iet ;&$ #reate a script that should print foo or ,ar when user input foo or ,ar otherwise show something else& Ansvim script,sh #/=in/=ash L1'X1 if ; XL1 '' foo
foo =ar data foo or =ar
;&$2 >ount a iso file placed at /root permanently to a directory /mnt/data& Ansrootstation$ 678s - /root/oracei,iso -rw-r--r--, 1 root root 1++>90 W: 2. 20!1F /root/oracei,iso rootstation$ 678vim /etc/fsta= /root/oracei,iso /mnt/data iso+0 roDoop 0 0 !w7 rootstation$ 678mo:nt -a ;&$5 #onfigure yourself as I1#1I initiator to the I1#1I target instructor&e4ample&com& Bhen create a partition of $"%%>J and mount it under /mnt/data$& Ansrootstation$ 678y:m insta iscsi-initiator-:tis
ow discover the target =y :sing foowing command
rootstation$ 678iscsiadm -m discovery -t st -p instr:ctor,e8ampe,com 3tarting iscsid! ; 4 < 1+2,1.,0,259!F20D1 i7n,200.-0+,com,e8ampe!server,target1 ow ogin into target =y :sing this command
rootstation$ 678iscsiadm -m node i7n,200.-0+,com,e8ampe!server,target1 - Gogging in to ;iface! defa:tD target! i7n,200.0+,com,e8ampe!server,target1Dporta! 1+2,1.,0,5DF20< Gogin to ;iface! defa:tD target! i7n,200.-0+,com,e8ampe!server,target1D porta! 1+2,1.,0,5DF20< s:ccessf:, ow ist yo:r target to check itSs nameD :se the foowing command & create a partition of 1200 & mo:nt it on /mnt/data1
rootstation$ 678fdisk - rootstation$ 678fdisk /dev/sd= #M)(6! *3-compati=e mode is deprecated, (tSs strongy recommended to switch off the mode Acommand ScS and change dispay :nits to sectors Acommand S:S, Command Am for hep! n Lirst cyinder AF9.-F0901D defa:t F9.! Ksing defa:t va:e F9. Gast cyinderD Ncyinders or NsiEeP4DD6Q AF9.-F0901D defa:t F0901!N1200 Command Am for hep! w rootstation$ 678partpro=e /dev/sd= rootstation$ 678mkfs,e8t9 /dev/sd=1 rootstation$ 678mkdir /mnt/data1 rootstation$ 678=kid /dev/sd=1 ??/etc/fsta= /dev/sd=1! KK(*'"d.=a.>eF-df+>-950F-aafd-f+22c911++c" $B%'"e8t9"
rootstation$ 678vim /etc/fsta= KK(*'"d.=a.>eF-df+>-950F-aafd-f+22c911++c" !w7 rootstation$ 678mo:nt -a
/mnt/data1
e8t9 Tnetdev 1 2
;&$( Bhe user paula should not have permission to schedule a cron Eo,& Ansrootstation$ 678vim /etc/cron,deny pa:a !w7 rootstation$ 678/etc/init,d/crond restartJchkconfig crond on ;&$H C4tend your we,site& #reate a directory in document root name as secret& laced document root in configuration file as /var/www/html/secret& Bhis we,-site should ,e access on your local host and should ,e acces on others& Ansrootstation$ 678mkdir /var/www/htm/secret rootstation$ 678vim /var/www/htm/secret/inde8,htm oca wesite !w7
rootstation$ 678vim /etc/httpd/conf/httpd,conf @Virt:aHost 1+2,1.,0,1>!.0? 3erver)dmin rootOdesktop1>,e8ampe,com *oc:mentoot /var/www/htm/secret A*efine here yo:r doc:ment root 3erverame desktop1>,e8ampe,com A*efine here yo:r we=site name *irectory(nde8 inde8,htm A*efine here directory inde8 @/Virt:aHost? !w7 rootstation$ 678/etc/init,d/httpd restart Jchkconfig httpd on rootstation$ 678einks http!//desktop1>,e8ampe,com/secret
JC1B