rhce lab exam practice question and answe

12
TeQ RecipeS Your "COOKBOOK" Of Open Source And Various Technologies HOME ABOUT CONTACT US PRIVACY POLICY RHCE Training Delhi Best Red Hat Partner for 7 Years 10200+ Red Hat Certified Students RHCE Lab Exam Practice Question and Answers Posted in: Linux, RHCSA and RHCE. These are some questions i faced in my RHCSA and RHCE lab exams and following steps i have taken to clear my both exams. If you want to clear both the exams in a single attempt then i would request you to follow these steps i have taken. Note:- This was my Lab Scenario, in your exam the lab may be completely different i am just sharing my lab experience with you and guiding you how i solved my both labs or you can setup your own lab at home and try these questions for practice. For RHCSA visit here RHCE Note:- new virtual system will be given for RHCE Exam Paper so set the password and put ur system on dhcp according to the exam paper. IPADD=DHCP DNS 192.168.0.254 YUM Repository URL ftp://instructor.example.com/pub/rhel/dvd/Server .example.com 192.168.0.0/24 (ur n/w address) .remote.test 192.168.1.0/24 (cracker's n/w address) Password for all users=password Initial Configuration :- Go to single user mode and set the password. Firewall and Selinux configuration #lokkit --disabled #lokkit --selinux=permissive #setup Setup the network configuration to dhcp and dns as specified. Now set yum Client Posted by hemant on December 6, 2014 Free GRE Practice Test Online Test Series For GRE Exam. 5000+ Practice Question. Join Now ! Page 1 of 12 RHCE Lab Exam Practice Question and Answers | TeQ RecipeS 2/25/2015 http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

Upload: mathavan-sundharamoorthy

Post on 12-Sep-2015

32 views

Category:

Documents


14 download

DESCRIPTION

RHCE

TRANSCRIPT

  • TeQ RecipeSYour "COOKBOOK" Of Open Source And Various Technologies

    HOME ABOUT CONTACT US PRIVACY POLICY

    RHCE Training DelhiBest Red Hat Partner for 7 Years 10200+ Red Hat Certified Students

    RHCE Lab Exam Practice Question and AnswersPosted in: Linux, RHCSA and RHCE.

    These are some questions i faced in my RHCSA and RHCE lab exams and following steps i havetaken to clear my both exams. If you want to clear both the exams in a single attempt then i wouldrequest you to follow these steps i have taken.

    Note:- This was my Lab Scenario, in your exam the lab may be completely different i am just sharingmy lab experience with you and guiding you how i solved my both labs or you can setup your own labat home and try these questions for practice. For RHCSA visit here

    RHCE

    Note:- new virtual system will be given for RHCE Exam Paper so set the password and put ur systemon dhcp according to the exam paper.

    IPADD=DHCPDNS 192.168.0.254YUM Repository URL ftp://instructor.example.com/pub/rhel/dvd/Server

    .example.com 192.168.0.0/24 (ur n/w address)

    .remote.test 192.168.1.0/24 (cracker's n/w address)

    Password for all users=password

    Initial Configuration :-

    Go to single user mode and set the password.Firewall and Selinux configuration

    #lokkit --disabled#lokkit --selinux=permissive#setup

    Setup the network configuration to dhcp and dns as specified.

    Now set yum Client

    Posted by hemant on December 6, 2014

    Free GRE Practice TestOnline Test Series For GRE Exam. 5000+ Practice Question. Join Now !

    Page 1 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #vim Server.repo[Server]name=Serverbaseurl=ftp://192.168.0.254/pub/rhel6/dvd/Serverenabled=1gpgcheck=0

    :wq!

    #init 6

    Login with root

    Now start checking conectivity

    #ifconfig#hostname#ping 192.168.0.254 ////server ( instructor) ip address#nslookup 192.168.0.[100+X] //// your ip address# yum list all

    1) Selinux

    Set SELinux to enforcing mode

    #lokkit --disabled#lokkit --selinux=enforcing#sestatus#setenforce 1#sestatus

    2) Ip forwarding

    Configure your host such that it can forward ipv4 packets

    #vi /etc/sysctl.confChange net.ipv4.ip_forward = 0 change 0 to 1

    :wq!

    #sysctl -

    Note:- install nmap to check the configuration later

    3) SMTP

    Note: check username

    Configure an SMTP mail server. Your host should be able to receive remote mails.Mail of student should be spooled to /var/spool/mail/student.

    Page 2 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #rpm -qa postfix#vi /etc/postfix/main.cf

    Search for [ine no.113] #inet_interface=all remove # of the lineAdd [Line no.116] # to the line inet_interface=localhost

    :wq!

    #service postfix restart#chkconfig --level 35 postfix on#mail [email protected]#su - student#mail ////you will see the mail#q

    Remote Checking go to base system

    #mail [email protected]

    Go to virtual system and check

    #mail ////you will see the mail#q#logout

    4)Alias

    Note: check usernames

    All mails sent to admin user should be directed to harryCreate user if not present and set password.

    #useradd harry#passwd harry#useradd admin#passwd admin

    #vi /etc/aliasesAt theendadmin: harry:wq!

    #newaliases

    Local testing

    #mail [email protected]

    #su - harry$mail

    Page 3 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • Remote testing

    #mail [email protected]

    Now go to virtual system

    $mail$logout

    4) Script

    Create a script in bash /root/s1.sh such that ,If the script is run in thefollowing manner # /root/s1.sh fooo/p > barAND# /root/s1.sh baro/p > fooMake sure that if the no. arguement is not provided properly , then error o/pshould be displayed aso/p > foo|barIf wrong arguement is provided , then error o/p should be displayed aso/p > foo|bar

    #vi /root/s1.sh#!/bin/bashIf [ $# -ne 1 ]; thenecho foo|bar >&2 ///use this if redirection is derelif [ $1 = foo ]; thenecho barelif [ $1 = bar ]; thenecho fooelseecho foo|bar >&2 ///use this if redirection is derfi:wq!

    #chmod u+x /root/s1.sh#/root/s1.sh#/root/s1.sh foo#/root/s1.sh bar#/root/s1.sh abcd

    5) FTP

    Note: Check username

    Configure an ftp server. User should be able to login via ftp .anonymous user can download from your site.This service must be accessible only over .example.com network

    #useradd sam#passwd sam#yum install vsftpd*#head -15 /etc/vsftpd/vsftpd.confCheck anonymous_enable=yes

    Page 4 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #tail -5 /etc/vsftpd/vsftpd.confCheck tcp_wrapper=yes

    Note:- if any of the above is no then open the file with vi editor and change to yes.

    #service vsftpd restart#chkconfig --level 35 vsftpd on#getsebool -a | grep ftp#setsebool -P ftp_home_dir 1# getsebool -a | grep ftp#vi /etc/hosts.deny

    vsftpd:ALL EXCEPT .example.com /// depends on question

    or

    vsftpd:.my133l.org

    wq!

    Local testing

    #yum install ftp#ftp 192.168.0.[100+X]Username: samPassword: passwordftp> bye

    remote testing

    #ftp 192.168.0.[100+X]Username: samPassword: passwordftp> bye

    6) NFS

    Share a directory /common over a n/w ,accessable to (domainX.example.com) .example.comnetwork.

    #mkdir /common#rpm -qa nfs-utils

    #vi /etc/exports/common 192.168.0.0/24(sync)

    wq!

    #service nfs restart#chkconfig --level 35 nfs on

    Local testing

    Page 5 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #showmount -

    Remote testing

    #showmount -e 192.168.0.117

    7) Loop

    Mount an iso file /root/boot.iso on /disks . This mount should be persistant across system restart

    Note:- boot.iso file will be avalable in /root

    #cd#ls#mkdir /disks#vi /etc/fstab

    /root/boot.iso /disks iso9660 defaults,loop 0 0

    wq!

    #mount -#df -!

    8) SSH

    Congigure ssh server..my133l.org (.remote.test) should be denied access to ftp server

    #yum install openssh-server#service sshd restart#chkconfig --level 35 sshd on#vi /etc/hosts.denysshd:.my133l.org //// depends on questionOR

    sshd:ALL EXCEPT .example.com

    :wq!#service sshd restart

    Remote testing

    #ssh [email protected]#logout

    9) Apache

    Host an apache webserver over your hostname. The webpage to be hosted is shared asftp://instructor.example.com/pub/web/station.html.

    Page 6 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • The name resolution is provided on your dns server.Do not edit the webpage contents .

    #yum install lftp*#yum install http*#lftp 192.168.0.254~>cd /pub/web~>mget station*~>bye#ls#mv station.html /var/www/html/index.html#vi /etc/httpd/conf/httpd.conf

    Copy the 7 line and Remove #

    ServerAdmin [email protected] /var/www/htmlServerName serverX.example.comErrorlog logs/serverX.example.com.........Customlog logs/serverX.example.com.........

    /// save the file and exit

    #httpd -#service httpd restart#chkconfig --level 35 httpd on#restorecon -R /var/www/html#elinks http://serverX.example.com

    Check with firefox if needed

    Remote testing

    #elinks serverX.example.com

    10) iSCSI

    Import an iscsi disk from the server instructor.example.com(192.168.0.254)The iscsi disk must be mounted as /mnt/iscsi .This mount should be persistent across reboot.

    #yum install iscsi-initiator-utils#iscsiadm -m discovery -t st p instructor.example.com

    Copy iqn.2010-09.com.example:rdisks.serverX

    #iscsiadm -m node T iqn.2010-09.com.example:rdisks.server17 p 192.168.0.254

    #fdisk cu /dev/sda

    check how to create partition using fdisk here

    format the partition as per the given filesystem

    Page 7 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #mkfs.ext4 /dev/sda1#mkdir /mnt/iscsi#blkid /dev/sda1

    Copy UUID

    #vi /etc/fstab

    Paste uuid without /mnt/iscsi ext4 defaults,_netdev 0 0

    wq!

    #mount -#df -!#cd /mnt/iscsi#lftp 192.168.0.254~>cd pub~>get a~>bye#ls

    12)Virtual Web

    Host a virtual website over (wwwX.example.com) d.example.com . The webpage to be hostedis shared asftp://instructor.example.com/pub/web/www.html .Create a DocumentRoot /var/www/virtual for hosting this page .

    #lftp 192.168.0.254~>cd pub/web~>mget ww*~>bye#ls#mkdir /var/www/virtual#mv www.html /var/www/virtual/index.html#vi /etc/httpd/conf/httpd.conf

    Copy the last 7 and replace serverX to wwwX and DocumentRoot to /var/www/virtual

    And also remove # of NameVirtualHost *:80 and ip your ip address 192.168.0.[100+X] in place of *

    wq!

    #httpd #service httpd restart#chkconfig level 35 httpd on#restorecon R /var/www/virtual#elinks http://wwwX.example.com

    Remote testing

    #elinks http://wwwX.example.com

    Page 8 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • 13) Samba

    Create a samba share /common with share name common .Your workgroup should be IT .this share should be browseable . The natasha can access this shareas readable only .This share is accessible only over .example.com

    #yum install samba*#mkdir /common#vi /etc/samba/smb.conf

    When you scroll down you will find

    [GLOBAL]workgroup=MYGROUP Change it to IT

    go to the end of the script

    [common]path = /commonbrowseable = yesread list = natashahosts allow = 192.168.0

    wq!

    #testparm#service smb restart#smbpasswd a natasha#smbpasswd e natasha#service smb restart#chkconfig -level 35 smb on#chcon t samba_share_t /common#ls lZd /common#getsebool a | grep samba#setsebool P samba_enable_home_dir 1#getsebool a | grep samba#smbclient //192.168.0.[100+X]/common U natshaSmb:\>

    Remote testing

    #smbclient //192.168.0.[100+X]/common U natshaSmb:\>

    14) Cron Deny

    The user jean should not be able to add a cron job for herself

    #useradd jean#passwd jean#vi /etc.cron.denyJean:wq!

    Page 9 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • #su jean$crontab

    15) Secure Directory

    copy the file station.html from server ( /pub/web ) OR[ftp://instructor.example.com/pub/web/station.html] to /var/www/html/secrete/ . Secure the file & makeit available to only over apache webserver .

    #lftp 192.168.0.254~>cd /pub/web~>mget station*~>bye

    #mkdir /var/www/html/secure#cp station.html /var/www/html/secrete#vi /etc/httpd/conf/httpd.conf

    AllowOverride NoneOrder deny,allowAllow from serverX.example.comDeny from all

    wq!

    #httpd #service httpd restart#chkconfig level 35 httpd on

    Local testing

    Open firefox

    http://serverX.example.com/secure

    remote testing

    Open firefox

    http://serverX.example.com/secure

    16) Kernel Parameter

    Pass a parameter sysvctl=1 to your kernel at boot time. changes made should be persistant .[ /etc/cmdline output ]

    #vi /etc/grub.conf

    Kernel.............................................................................autorhgb quiet

    At the end of the above line add sysvctl=1

    Page 10 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • wq!

    #init 6

    NOTE :- Now check all your configuration after reboot

    #nmap 192.168.0.[100+X]

    ftp,ssh,smtp,http,nfs port should be open

    #chkconfig --list

    Iscsid,nfs,smb,sshd should be runing

    #cat /proc/cmdline

    #df !

    #smbclient //192.168.0.[100+X]/common u natasha

    #mail [email protected]

    #showmount

    #su harry

    $mail$logout

    #ftp 192.168.0.[100+X]Username:samPassword:password

    #elinks http://serverX.example.com#elinks http://wwwX.example.com

    Open firefox

    http://serverX.example.com/secure

    #/root/s1.sh#/root/s1.sh foo

    Page 11 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/

  • TEQRECIPES.COM All Rights Reserved.

    RHCSA Lab Exam Practice Question andAnswers

    Symantecs Backup Exec vs Netbackup

    #/root/s1.sh bar#/root/s1.sh abcd

    Best Of Luck For Your Exam

    8Like

    Page 12 of 12RHCE Lab Exam Practice Question and Answers | TeQ RecipeS

    2/25/2015http://teqrecipes.com/rhce-lab-exam-practice-question-and-answers/