RHCSA7 LAB134. Solution
RHCSA7 LAB134. Solution
Sol ution
-
Solution
-
-
Resou rces:
Files: h t t p : / / s e rve rX . example . com/logfile
-
Machines: serverx a n d d e s k t opX
Outcomes:
Two syst e m s confi g u red accord i n g to t h e specified req u i re m e nts t h a t fo l l ow.
-
-
[ s t u d e n t@s e r v er x - ] $ lab sa2 - r eview s e t u p
-
• Reset your deskt opX syste m .
• The system should a ut h e n t icate u s e rs using LDAP and Ke r b e r o s using t h e fo l l owi n g sett i n g s:
-
Name Va l u e
L D A P s e rver class room . example . com
- S e a rc h Base dc=example , dc=com
Use TLS Yes
-
Ke r b e ros K D C class room . example . com
Ke r b e ros Ad m i n class room . example . com
S e rver
-
-
• Home d i recto ries for yo u r LDAP u s e rs s h o u l d be a u to m a t i ca l ly m o u nted on access. These
home d i rectories a re s e rved from t h e N FS s h a re class room . example . com : /home/g u e s t s .
• s e rverX exports an N FSv4 s h a re ca l l e d /es sos. This s h a re needs to be m o u nted read-w rite
at boot o n /mn t /essos u s i n g Ker beros a u t h e nticat i o n , e n crypt i o n , and i nteg rity c h ec k i n g .
-
-
R H1 3 4- R H E L 7-en-1-2014061 0 307
-
C h a p t e r 1 5 . C o m p re h e n s i ve Review of System A d m i n i s t ra t i o n I I
Name Va l u e
Use T L S Yes
308 R H 1 3 4- R H E L7 - e n - 1 -20140610
-
Sol ution
-
2. Run aut hconfig - g t k, and enter the i nformation p rovid e d . Do not forget to u nc h e c k
-
t h e Use DNS to locate K D Cs for rea l m s o p t i o n .
I / h ome/g u e s t s /etc/au t o . g u e s t s
-
3. C reate a new file ca l l e d /etc/au t o . g u e s t s with t h e fo l l ow i n g contents:
-
1. I nsta l l the cifs-utils packa g e.
2. C reate t h e m o u nt point.
-
-
-
u s e r n ame= t y r i o n
p a s swo r d = s lapj o f f r eyslap
-
4. A d d t h e fo l l o w i n g l i n e to / e t c /fst ab:
-
5. M o u n t a l l fi l e syste ms, and i n s pect the m o u nted fi l e syste m .
-
1. C reate t h e m o u nt poi nt.
-
clas s r oom . example . com/ pub/keyt abs/de s k t o pX . keytab
-
4. Start a n d e n a b l e t h e nfs - secu r e . se rvice service.
5. M o u nt a l l fi l e syste ms. -
31 0 R H134- R H E L 7 - e n -1 -2014061 0
-
-
Solution
-
[ s t u d e n t @d e s k t o pX - ] $ sudo mount - a
-
5. Config u re a n e w 5 1 2 M i B l o g i c a l vo l u m e ca l l ed arya i n a n e w 2 G i B vo l u m e g ro u p ca l l e d
s t a r k.
-
1. C reate a 2 G i B p a r t i t i o n o n y o u r seco n d a ry d i s k.
[ s t u d e n t @d e s k t o p X - ] $ s u do fdisk /dev/vdb
Welcome to f d i s k ( u t il - li n u x 2 . 23 . 2 ) .
Command ( m f o r help ) : n
Partition type :
-
p p r imary ( 0 p r ima r y , 0 e x t e n d e d , 4 f r e e )
e e x t e n ded
Select ( d efault p ) : p
- P a r t i t i o n n u m b e r ( 1 - 4 , default 1 ) : E nt e r
Fi rst s e c t o r ( 2048 - 2 0 9 7 1519 , default 2048 ) : E nt e r
U s i n g default val u e 2048
Last s ec t o r , + s ec t o r s o r + s i z e { K , M , G } ( 2048 - 2 0 9 71 5 1 9 , default 20971519 ) : +2G
-
Partition 1 of t y p e Linux and of size 2 G i B i s s e t
Command ( m f o r h e lp ) : t
-
Selec t e d p a r t i t i o n 1
Hex c o d e ( t y p e L t o l i s t all c o d e s ) : Se
Changed t y p e of p a r t i t i o n ' Li n u x ' t o ' Li n u x LVM '
- Command ( m f o r h e l p ) : w
The p a r t i t io n table h a s been alt e r e d !
-
2. Tu r n t h e n e w partit i o n i nto a phys i c a l vo l u m e.
- i
I [ s t u d e n t@de s k t opX - ] $ sudo vgcreate s t a r k /dev/vdbl
!
•
[ s t u d e n t @d e s k t opX - ] $ sudo lvc reate - n arya - L 512M s t a r k
-
- R H1 3 4- R H E L 7-en-1-2014061 0 311
-
-
[ s t u d e n t@d e s k t o pX -
] $ sudo mkfs - t xfs /dev/ s t a r k/arya
[ s t u d e n t@d e s k t opX -
$ sudo mkdir -p /mnt/unde rfoot
)
7. A d d t h e fo l l o w i n g l i n e to / e t c /f s t ab: -
8. M o u nt a l l fi l e systems.
-
- ] $ sudo mount - a
6. Yo u r system s ho u l d be o u tfitted with a new 512 M i B swa p p a r t i t i o n , automat ica l l y act ivated -
at boot.
Command ( m fo r help ) : n
P a r t i t ion t y p e :
p p r im a r y ( 1 p r imary , 0 e x t e n d e d , 3 f r e e ) -
e extended
S e l e c t ( d efault p ) : p
P a r t i t ion n u m b e r ( 2 - 4 , default 2 ) : E n t e r
F i r s t sec t o r ( 4196352 - 20971519 , d e f a u l t 4196352 ) : E n t e r -
Command ( m f o r help ) : t
P a r t i t ion n u m b e r ( 1 , 2 , default 2 ) : E n t e r -
-
Command ( m f o r h e lp ) : w
T h e p a r t i t i o n t ab l e has been al t e red !
I
WARN I N G : Re - r ea d i n g t h e p a r t i t io n table failed wit h e r r o r 16 : Device o r r e s o u r c e
busy .
The k e r nel s t ill u ses t h e old table . The new t a b l e will be u sed at
the next r e b o o t or af t e r you r u n par t p r o be ( B ) or k p a r t x ( B )
Syn c i n g d i s k s .
[ s t u d e n t@d e s k t o pX - ] $ sudo partprobe
-
-
312 R H134- R H E L 7 - e n -1 -2014061 0
-
-
Solution
-
-
[ s t u d e n t@des k t opX - ] $ sudo mkswap /dev/vdb2
-
-
[ s t ud e n t@de s k t opX - ] $ sudo swapon - a
-
[ s t ud e n t@de s k t o pX - ] $ for NEWUSER in stannis j offrey r enly robb ; d o
> s u d o u s e r add - G kings S { N EWUSER}
> done
-
-
2. Add an ACL o n /iron t h rone g ra n t i n g u s e rs in the kings g ro u p read a n d w rite
p r i v i l eges. D o not forget to add execute p e r m i s s i o n s as we l l , s i n ce t h i s is a d i recto ry.
-
[ s t u d e n t@de s k t o pX - ] $ sudo s e t facl - m g : kings : rwX / i r o n t h rone
-
RH134- R H E L 7-en-1-201 4061 0 313
-
-
3. Add an ACL for the user j of f r ey, w i t h o n l y rea d and execute p e r m issions.
9. I n sta l l the httpd a n d mod_ss/ packages, t h e n e n a b l e and start the h t t pd . se rvice se rvice.
-
[ s t u d e n t@de s k t opX - ] $ s u d o fi rewall - cmd - - reload
2. Add a new defa u lt f i l e context for the /doc root d i rectory and a l l its d esce n d a nts.
-
-
-
S o l ution
-
12. h t t p : / / s e r v e rX . e x am p l e . c o m / l o g f i l e conta i n s t h e logs fo r a rece nt
p roject. Dow n l oa d t h i s f i l e , t h e n extract all l i nes e n d i n g i n ERROR o r FAI L to t h e f i l e
-
/ home/ s t u de n t / e r r o r s . t x t . A l l l i nes s h o u l d b e kept i n the o rd e r i n w h i c h t h ey a p pe a r i n
t h e l o g f i l e.
-
1. Dow n l oa d t h e l o g f i l e.
I
i
[ s t ud e n t@de s k t o pX - ] $ wget h t t p : //serverX . example . com/logfile
[ s t u d e n t @d e s k t opX - ] $ g r e p -e ' ERROR$ ' -e ' FAIL$ ' logfile > /home/student/
e r rors . t xt
--
d / r u n/veryver �:;� at ile 1777 r o o t r o o t 5 s
I
If any req u i re m e n t comes up as " FA I L" , rev i s i t that req u i re m e nt, a n d t h e n reboot a n d g ra d e
again.