You are on page 1of 11

RHCE 2

1) Set SELinux to enforcing mode


#setenforece 1
#lokkit selinux=enforcing
#sestatud
2) Configure your ost suc tat it can for!ard i"#$ "ackets %
##im &etc&sysctl%conf
net%i"#$%i"'for!ard=1
(!)*
#sysctl +"
,) #yum install "ostfix- +y
#r"m +)a "ostfix
##im &etc&"ostfix&main%cf
inet'interface=all .remo#e comment)
#inet'interface=localost .comment ere)
(!)*
#&etc&init%d&"ostfix restart
#ckconfig "ostfix on
Ceck from /ysical 0acine%% .Remote 1esting)
#mail root2deskto"$3%exam"le%com
Ceck on #irtual m&c%%!ill get mail%%
$)##im &etc&alises
admin( natasa
(!)*
#ne!alises
Ceck from /ysical 0acine%% .Remote 1esting)
#mail admin2deskto"$3%exam"le%com
Ceck on #irtual m&c%%!ill get mail%
#su natasa
4mail
3)##im scri"t%s
#*&5in&5as
if 6 4# +ne 1 78 ten
eco +e 9:n;n#alid Entry:n<
elif 6 41 = ="erl= 78 ten
eco +e 9:n"yton:n<
elif 6 41 = ="yton= 78 ten
eco +e 9:n"erl:n<
else
eco +e 9:n"erl>"yton:n<
fi
(!)*
#cmod u?x scri"t%s
#%&scri"t%s "erl
@) #yum install #sft"d-
##im &etc&#sft"d&#sft"d%conf
tc"'!ra""ers=AES
(!)*
#&etc&init%d&#sft"d restart
#ckconfig #sft"d on
#getse5ool +a > gre" ft"
#setse5ool +/ ft"'ome'dir 1
#yum install nma"-
#nma" 1B2%1@C%D%$3 .1o ceck te ser#ice)
##im &etc&ost%deny
#sft"d(ELL EFCE/1 %exam"le%com
(!)*
Ceck from /ysical 0acine%% .Remote 1esting)
#ft" 1B2%1@C%D%$3 .#irtual m&c i")
G) #mkdir &nfssare
#yum install nfs- +y
#r"m +)a nfs+utils
##im &etc&ex"orts
&nfssare 1B2%1@C%D%D&233%233%233%D.sync)
(!)*
#&etc&init%d&nfs restart
#ckconfig nfs on
Ceck from /ysical 0acine%% .Remote 1esting)
#so!mount +e 1B2%1@C%D%$3
#cd &nfs&domainsFare
C) #mkdir &disk
##im &etc&fsta5
&root&5oot%iso &disk auto or.isoB@@D) defaultsHloo" D D
(!)*
#mount +a
#df +1
B)#yum install o"enss+ser#er- +y
#yum install ssd-
#&etc&init%d&ssd restart
#ckconfig ssd on
##im &etc&ost%deny
ssd(ELL EFCE/1 %exam"le%com
(!)*
Ceck from /ysical 0acine%% .Remote 1esting)
#ss natasa2deskto"$3%exam"le%com
1D)#yum install tt"d-
#lft" 1B2%1@C%D%23$.ser#er)
Ils I cd "u5&!e5
I get station%tml
#c" station%tml &#ar&!!!&tml&index%tml
##im &etc&tt"d&conf&tt"d%conf
co"y last G lines J "aste
K#irtualHost deskto"$3%exam"le%com(CDI
Ser#erEdmin !e5master2deskto"$3%exam"le%com
LocumentRoot &#ar&!!!&tml
Ser#erMame deskto"$3%exam"le%com
(!)*
#tt"d +t
#&etc&init%d&tt"d restart
#ckconfig tt"d on
#restorecon +R# &#ar&!!!&tml
#elinkstt"(&&deskto"$3%exam"le%com
Ceck from /ysical 0acine%% .Remote 1esting)
#elinkstt"(&&deskto"$3%exam"le%com
11)#yum install iscsi+initiator+utils-
#iscsiadm +m disco#ery +t st +" 1B2%1@C%D%23$
;t gi#es i)n%no co"y J "aste it to login
#iscsiadm +m node +1 i)n%no ."aste) +l
#fdisk &de#&sd5
create a "artitionNI
#mkfs%ext$ &de#&sd51
#mkdir &mnt&iscsi
#5lkid &de#&sd51 .;t gi#es OO;L)
##im &etc&fsta5
OO;L &mnt&iscsi ext$ defaultsH'netde# D D
(!)*
#mount +a
#cd &mnt&iscsi
#lft" 1B2%1@C%D%23$Ido!nload iscsi%txt file
#df +1
12)#lft" 1B2%1@C%D%23$
Icd "u5&!e5
I gettt"(&&!!!%tml
#mkdir &#ar&!!!&#irtual
#c"tt"(&&!!!%tml&#ar&!!!&#irtual&index%tml
##im &etc&tt"d&conf&tt"d%conf
Mame#irtualHost deskto"$3%exam"le%com
co"y last G lines J "aste
K#irtualHost !!!$3%exam"le%com(CDI
Ser#erEdmin !e5master2!!!$3%exam"le%com
LocumentRoot &#ar&!!!&#irtual
Ser#erMame !!!$3%exam"le%com
(!)*
#tt"d +t
#&etc&init%d&tt"d restart
#ckconfig tt"d on
#restorecon +R &#ar&!!!&#irtual
#co!n arry &#ar&!!!&#irtual
#elinkstt"(&&!!!$3%exam"le%com
Ceck from /ysical 0acine%% .Remote 1esting)
#elinkstt"(&&!!!$3%exam"le%com
13) #mkdir &#ar&!!!&tml&secure
#c" station%tml &#ar&!!!&tml&secure&index%tml
##im &etc&tt"d&conf&tt"d%conf
KLirectory 9&#ar&!!!&tml&secure<I
order denyHallo!
Ello! from deskto"$3%exam"le%com
Leny all
K&LirectoryI
(!)*
#tt"d +t
#&etc&init%d&tt"d restart
#ckconfig tt"d on
#elinkstt"(&&!!!$3%exam"le%com
Ceck from /ysical 0acine%% .Remote 1esting)
#elinkstt"(&&!!!$3%exam"le%com
1,) #yum install sam5a-
#mkdir &sam5a
##im &etc&sam5a&sm5%conf
!orkgrou"=PQRRSRQO/
co"y last G lines J "aste
6sam5a7
"at=&sam5a
5ro!sa5le=yes
read list=natasa
osts allo!= 1B2%1@C%D%
(!)*
#test"arm
#sm5"ass!d +a natasa
#&etc&init%d&sm5 restart
#ckconfig sm5 on
#ccon +R +t sam5a'sare't &sam5a
#sm5client &&1B2%1@C%D%$3&sam5a +O natasa
1$) ##im &etc&cron%deny
Tean
(!)*
#su Tean
4cronta5 +e
;t !ill not allo! Tean%
1@)##im &5oot&gru5&gru5%conf
Efter kernal entryHlast !rite
sys#ctl=1
(!)*
RHCE 2
1)# yum install +y nt"
# ckconfig nt"d on
# i"ta5les +; ;M/O1 +m state state MEP +m ud" +" ud" d"ort 12, +T ECCE/1
# ser#ice i"ta5les sa#e
# ser#ice nt"d start
# nt") +"
2)# yum install +y nt"
Edit te &etc&nt"%conf file and comment te follo!ing lines(
ser#er D%centos%"ool%nt"%org i5urst
ser#er 1%centos%"ool%nt"%org i5urst
ser#er 2%centos%"ool%nt"%org i5urst
ser#er ,%centos%"ool%nt"%org i5urst
Still in te &etc&nt"%conf fileH add te follo!ing line(
ser#er Ser#er%exam"le%com
Ecti#ate te nt" ser#ice at 5ootH start it and test te configuration(
# ckconfig nt"d on
# ser#ice nt"d start
# nt") +"
,)Edit te &etc&rsyslog%conf file and uncomment te follo!ing lines(
#40odLoad imtc"
#4;n"ut1C/Ser#erRun 31$
1enH start te ser#ice and set u" te fire!all configuration(
# ser#ice rsyslog restart
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 31$ +T ECCE/1
# ser#ice i"ta5les sa#e
$)Edit te &etc&rsyslog%conf file and uncomment te follo!ing lines(
#4PorkLirectory &#ar&li5&rsyslog
#4EctionUueueVileMame f!dRule1
#4EctionUueue0axLiskS"ace 1g
#4EctionUueueSa#eQnSutdo!n on
#4EctionUueue1y"e LinkedList
#4EctionResumeRetryCount +1
Still in te &etc&rsyslog%conf fileH re"lace te follo!ing line as s"ecified(
#-%- 22remote+ost(31$
5y( -%- 22Ser#er%exam"le%com(31$
Restart te ser#ice and test te configuration(
# ser#ice rsyslog restart
# logger +" localD%notice +t 1ES1 91est<
# gre" 91ES1< &#ar&log&messages
3)# yum grou"install +y 9C;VS file ser#er<
Create a ne! &etc&sam5a&sm5%conf file and add te follo!ing lines(
!orkgrou" = 0ASRQO/
net5ios name = 0ASERWER
security = user
"assd5 5ackend = td5sam
6sam5a7
5ro!sea5le = yes
"at = &o"t&sam5a
#alid users = sam
!rita5le = yes
Ceck te syntax of te configuration file(
# test"arm
# mkdir &o"t&sam5a8 yum install +y setrou5lesoot+ser#er
# semanage fcontext +a +t sam5a'sare't 9&o"t&sam5a.&%-)X<8 restorecon +r &o"t&sam5a
# i"ta5les +; ;M/O1 +m state state MEP +m ud" +" ud" d"ort 1,G +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m ud" +" ud" d"ort 1,C +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 1,B +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort $$3 +T ECCE/1
# ser#ice i"ta5les sa#e
# ckconfig sm5 on8ckconfig nm5 on8ckconfig !in5ind on8 ser#ice sm5 start8ser#ice nm5
start8ser#ice !in5ind start
Create te sam5a user sam !it te "ass!ord redat(
# useradd +s &s5in&nologin sam8 sm5"ass!d +a sam
Ceck te configuration(
# yum install +y sam5a+client8 sm5client &&localost&sam5a +O samYredat
@)# yum install +y cifs+utils
1est te connection to te ser#er
mount +t cifs &&Ser#er&sam5a +o r!Husername=samH"ass!ord=redat &mnt
Edit te &etc&fsta5 file and add te follo!ing line(
&&Ser#er&sam5a &mnt cifs r!Husername=samH"ass!ord=redat D D
G)# yum install +y tt"d
# mkdir +" &#ar&!!!&tml&secret8eco 91ES1< I &#ar&!!!&tml&secret&index%tml
# restorecon +R &#ar&!!!&tml&secret
Edit te &etc&tt"d&conf&tt"d%conf file and add te follo!ing lines(
KLirectory 9&#ar&!!!&tml&secret<I
Eut1y"e Zasic
EutMame 9/ass!ord "rotected area<
EutOserVile &etc&tt"d&conf&"ass!d
Re)uire user tom
KLirectory &I
Ceck te configuration(
# ser#ice tt"d configtest
# t"ass!d +c &etc&tt"d&conf&"ass!d tom
# i"ta5les +; ;M/O1 +" tc" +m state state MEP +m tc" d"ort CD +T ECCE/1
# ser#ice i"ta5les sa#e
# ckconfig tt"d on8ser#ice tt"d start
1est te configuration(
# yum install +y elinks8elinkstt"(&&localost&secret
C)# yum grou"install +y 9MVS file ser#er<
# mkdir +" &o"t&tools
# i"ta5les +; ;M/O1 +m state state MEP +m ud" +" ud" d"ort 111 +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 111 +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 2D$B +T ECCE/1
# ser#ice i"ta5les sa#e
# ckconfig r"c5ind on
# ckconfig nfs on
# ckconfig nfslock on
# ser#ice r"c5ind start
# ser#ice nfs start
# ser#ice nfslock start
Edit te &etc&ex"orts file and add te follo!ing line(
&o"t&tools Client.r!Hno'root's)uas)
# ex"ortfs +a#r
B)# yum install +y nfs+utils
Edit te &etc&fsta5 file and add te follo!ing line(
Ser#er(&o"t&tools &mnt nfs defaults D D
1D)Edit te &etc&ss&ssd'config file and add te follo!ing line(
/ermitRootLogin no
Reload te ss configuration
# ser#ice ssd reload
/S( don[t forget to create a user account or set u" a console access 5eforeH oter!ise you !ill a#e to
reinstall te ser#er .it a""ens to me*)
11)Edit te &etc&sysctl%conf file and add te follo!ing line(
net%i"#$%conf%icm"'eco'ignore'all = 1
# sysctl +"
12)Edit te &etc&osts%deny file and add te follo!ing line(
ssd( %5lackat%org
# ser#ice ssd reload
1,)# yum install +y #sft"d
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 2D +T ECCE/1
# i"ta5les +; ;M/O1 +m state state MEP +m tc" +" tc" d"ort 21 +T ECCE/1
# ser#ice i"ta5les sa#e
Edit te &etc&sysconfig&i"ta5les+config file and cange te ;/1EZLES'0QLOLES directi#e(
;/1EZLES'0QLOLES=<nf'conntrack'ft" nf'nat'ft"<
# ser#ice i"ta5les restart
# ckconfig #sft"d on
Edit te &etc&#sft"d%conf file and re"lace 9local'ena5le=AES< !it 9local'ena5le=MQ<%
# ser#ice #sft"d start
Edit te &etc&osts%deny file and add te follo!ing line(
#sft"d( ELL EFCE/1 %exam"le%com
1$)Edit te &etc&aliases file and add te follo!ing line(
root( Toe
# useradd Toe
# ne!aliases
RHCE EMSPER ,
1)vim /etc/sysconfig/selinux(Set the SELINUX To enforcing & reboot the Virtul !chine"
5%i"ta5les V
c%ser#ice i"ta5les sa#e
2)E%;/ Vor!arding
a%#im &etc&sysctl
i%Set te ;/W$ for!arding to 91<.Sa#e J Exit)
5%sysctl +".1o #erify)
,)E%Configure SSH
a%Q/EMSSH is installed 5y defaultH if notH
i%yum install o"enss
5%ckconfig ssd on
c%#im &etc&osts%deny.ELL 1HE VQLLQP;MS)
i%sd(my1,,t%org
d%ser#ice ssd restart
$)E%0ake sure Sendmail is MQ1 installed and installpostfix
a%yum install "ostfix
5%ckconfig "ostfix on
c%#im &etc&"ostfix&main%cf.0ake te follo!ing canges)
i%myostname = station%domainF%exam"le%com
ii%mydomain = exam"le%com
iii%myorigin = 4myostname
i#%inet'interface = all
v#commentinet$%rotocols & ll
#i%mydestination = 4myostnameH localost%4mydomainxH4mynet!orks
#ii%mynet!orks = KAour ;/I&2$H 12G%D%D%D&C
#iii%relay'domains = 4mydestination
d%ser#ice "ostfix restart
3)E%V1/ Configuration(
a%yum install #sft"d-
5%ckconfig #sft"d on
c%#im &etc&#sft"d&ft"users.ELL 1HE OSERS 1Q RES1R;C1)
d%#im &etc&access%deny.ELL 1HE HQS1S 1Q LEMA ECCESS)
e%#sft"d(ELL EFCE/1 %exam"le%com
f%ser#ice #sft"d restart
@)E%Sam5a Configuration(
a%mkdir &sared
5%ccon t sam5a'sare't &sared
c%yum install sam5a-
d%ckconfig sm5 on
e%ckconfig nm5 on
f%#im &etc&sam5a&sm5%conf.0ake te follo!ing canges)
i%!orkgrou" = S0ZSRQO/
ii%0ERE 1HE VQLLQP;MS EM1R;ES E1 1HE EML QV 1HE V;LE
iii%6sm5sare7
i#%comment = Sam5a Sare
#%"at = &sared
#i%5ro!sea5le = yes
#ii%read only = yes
#iii%#alid users = Matasa
ix%guest ok = no
x%osts allo! = 1B2%1@C%D%D% 12G%D%D%1%
g%ser#ice sm5 restart
%eco 9"ass!ord > ++ stdin sm5"ass!d a natasa
i%"d5edit L.1Q CHECR VQR 1HE S0Z OSERS)
T%test"arm.1Q CHECR ;V 1HE SAM1EF ;M S0Z%CQMV ;S QR)
k%sm5client + L 1B2%1@C%D%2 u natasa.on Wirtual 0acine
l%sm5client L &&1B2%1@C%D%2&sm5sare O Matasa.QM ZESE 0ECH;ME)
G)E%E/ECHE
oyum install tt"d-
ockconfig tt"d on
ocd &#ar&!!!&tml
o'getft%(//instructor#exm%le#com/%ub/rhce/sttion#html
om# station%tml index%tml
o#im &etc&tt"d&conf&tt"d%conf.0ake te follo!ing entry)
\KWirtualHost K;/I(CDI
+Ser#erMamestation%domainF%exam"le%com
+LocumentRoot&#ar&!!!&tml
\K&WirtualHostI
C)E%MVS(
a%#im &etc&ex"orts
i%&sared-%exam"le%com.SEWE J EF;1)
5%ser#ice nfs restart
c%ckconfig nfs on
B)E%Eliases(
a%useradd "aula
5%eco 9"ass!ord > ++ stdin "ass!d "aula
c%#im &etc&aliases.0ERE 1HE VQLLQP;MS EM1RA E1 1HE LES1)
i%acctmgr("aula.SEWE J EF;1)
d%ne!aliases
1D)
11)E%E/ECHE .ELL;1;QMEL)
omkdir &#ar&!!!&#irtual
ocd &#ar&!!!&#irtual
o'getft%(//instructor#exm%le#com/%ub/rhce/'''#html
om# !!!%tml index%tml
o#im &etc&tt"d&conf&tt"d%conf.0ake te follo!ing entry)
\uncommentMameWirtualHost
\KWirtualHost K;/I(CDI
+Ser#erMame!!!F%domainF%exam"le%com
+Ser#erElias!!!F
+LocumentRoot&#ar&!!!&tml
\K&WirtualHostI
ott"d t.1Q WER;VA 1HE SAM1EF ;M CQMV;SORE1;QM)
oser#ice tt"d restart
12)oWim &etc&gru"%conf.ELL 1HE VQLLQP;MS 1Q 1HE RERMEL /ERE0E1ERS)
\Sysctl=1
oRe5oot te ost and ceck if te "arameter is takenH 5y cat &"roc&cmdline
1,)
1$) omkdir &mnt&data
#im &etc&fsta5
\&root&5oot%iso&mnt&dataisoB@@DroHsyncHautoD D .SEWE J EF;1)
omount +a
13)omkdir &mnt&data1
oyum install iscsi+initiator-
oiscsiadm m disco#ery t st " K;/ of instructor%exam"le%comI
oiscsiadm m node 1 KME0E QV 1HE ;UMH VQOML EZQWEI +" K;/ of instructor%exam"le%comI
+l.1Q LQS;M)
oCREE1E E /ER1;1;QM QV 12DD 0Z OS;MS 1HE EZQWE /ER1;1;QM
o5lkid &de#&sdaM
oWim &etc&fsta5.make an entry at te EML of te V;LE)
\OO;L=K5lk;L of te "artitionI&mnt&data1'netde#D D
omount +a
1@)ouseradd "aula
o"ass!d "aula
oeco "aula II &etc&cron%deny
oser#ice crond restart
1G)ELL;1;QMEL PEZSERWER
om)*ir /vr/'''/html/secret
ocd &#ar&!!!&tml&secret
o'getft%(//instructor#exm%le#com/%ub/rhce/secret#html
om# secret%tml index%tml
o#im &etc&tt"d&conf&tt"d%conf.ELL 1HE VQLLQP;MS L;MES P;1H;M 1HE 1
S1
W;R1OEL HQS1)
+KLirectory &#ar&!!!&#irtualI
+order allo!Hdeny
+allo! fromlocalost
+K&LirectoryI
ott"d t.1Q WER;VA 1HE SAM1EF ;M CQMV;SORE1;QM)
oser#ice tt"d restart

You might also like