martes, 31 de diciembre de 2013

RHCT / RHCSA Exam Notes

 


Installation and Configuration
■ Perform network OS installation
■ Implement a custom partitioning scheme
■ configure printing
■ configure the scheduling of tasks using cron and at
■ attach system to a network directory service LDAP
■ configure autofs
■ add and manage users, groups, and quotas
■ configure filesystem permissions for collaboration
■ install and update RPMs
■ properly update the kernel RPM
■ modify the system bootloader
■ implement software LVM at install-time and run-time
■ use /proc/sys and sysctl to modify and set kernel run-time parameter

Lab Setup on  Exam
Remember the Key points of Lab Configuration:

1. Lab Configuration is on 192.168.0.0/24 for example.com domain and 192.168.1.0/24
forcracker.org domain.
2. DHCP Server is configured.
3. DNS Server is 192.168.0.254
4. One NIS Server is configured rhce.com and server is 192.168.0.254
Before starting debug Exam Think!
In Debug Section All Questions a compulsory! You should finish these all questions
within a hour.


QUESTION NO : 1
Make Successfully Resolve to server1.example.com where DNS Server is
192.168.0.254.

Answer: 1
vi /etc/resolv.conf
Write : nameserver 192.168.0.254

Explanation : If you have multiple name server (DNS), you can append another line.
First Request goes to the First name server if not found then goes to second name server.
Then try to resolve the Server1.example.com by using host or dig command.
Eg: host server1.example.com
When we use the DNS client tool first it sends the request to the DNS
server specified in /etc/resolv.conf as a name server. If that DNS is not found then it
sends the request to the Root name Server. I will explain about the root Name server.
  
QUESTION NO : 2
You are new System Administrator and from now you are going to handle the
system and your main task is Network monitoring, Backup and Restore. But you
don’t know the root password. Change the root password to redhat and login in
default Runlevel.

Answer and Explanation:
When you Boot the System, it starts on default Runlevel specified in /etc/inittab:

Id:?:initdefault:
When System Successfully boot, it will ask for username and password. But you
don’t know the root’s password.

1. Restart the System.
2. You will get the boot loader GRUB screen.
3. Press a and type 1 or s for single mode
ro root=LABEL=/ rhgb queit 1
4. System will boot on Single User mode.
5. Use passwd command to change.
6. Set redhat password.
7. Press ctrl+d

QUESTION NO : 3
One Logical Volume named lv1 is created under vg0. The Initial Size of that Logical
Volume is 100MB. Now you required the size 500MB. Make successfully the size of
that Logical Volume 500M without losing any data. As well as size should be
increased online.

Answer : 2
1. Verify the size of Logical Volume:
  # lvdisplay /dev/vg0/lv1

2. Verify the Size on mounted directory:
 # df –h
or
# df –h mounted directory name

3. Use :
# lvextend –L+400M /dev/vg0/lv1

4. to bring extended
# resize2fs /dev/vg0/lv1

 LVM Concepts

Multiple Physical Disks belongs to physical group. Using multiple disks belongs to
physical group we can create on Volume group. Under that Volume Group we can
create multiple Logical Volume and only these Logical Volume we can use. As well
as we can increase and decrease the size of Logical Volume by using lvextend,
lvresize etc.

QUESTION NO : 4
Create one partitions having size 100MB and mount it on /data.

Answer and Explanation:
1. To create new partition.
# fdisk /dev/hda

2. Type "n" For New partitions

3. It will ask for Logical or Primary Partitions. Press "l" for logical.

4. It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.

5. Type the Size: +100M  You can Specify either Last cylinder of Size here.

6. Press "P" to verify the partitions lists and remember the partitions name.

7. Press "w" to write on partitions table.

8. Either Reboot the System.

9. # mkdir /data

10. # vi /etc/fstab
Write:

/dev/hda? /data ext4 defaults 0 0
11. Verify by mounting on current Sessions also:

# mount /dev/hda? /data 
QUESTION NO : 5
 There are more then 400 Computers in your Office. You are appointed as a System
Administrator. But you don’t have Router. So, you are going to use your One Linux
Server as a Router. How will you enable IP packets forward?

Answer and Explanation:
1. /proc is the virtual filesystem, we use /proc to modify the kernel value at running
time. So For Current Session:

# echo “1” >/proc/sys/net/ipv4/ip_forward
2. /etc/sysctl.conf  when System Reboot on next time, /etc/rc.d/rc.sysinit scripts
reads the file /etc/sysctl.conf. So if you want to permanently set the IP forwarding
enable, You should set:
net.ipv4.ip_forward=1
Here 0 means disable, 1 means enable.

QUESTION NO : 6
There are two different networks, 192.168.0.0/24 and 192.168.1.0/24. Your System is
in 192.168.0.0/24 Network. One RHEL 4 Installed System is going to use as a
Router. All required configuration is already done on Linux Server. Where
192.168.0.254 and 192.168.1.254 IP Address are assigned on that Server. How will
make successfully ping to 192.168.1.0/24 Network’s Host?

Answer : 6
1. # vi /etc/sysconfig/network
GATEWAY=192.168.0.254

OR

# vi /etc/sysconf/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.?
NETMASK=255.255.255.0
GATEWAY=192.168.0.254

2. # service network restart

Explanation: Always packets go to default gateway if specified. First it search the
gateway assigned on interface name, then network global configuration file. The
System having IP Address 192.168.0.254, 192.168.1.254 is being used as Router so
we should set the gateway to that system .

QUESTION NO : 7
Make a swap partition having 100MB. Make Automatically Usable at System Boot
Time.

Answer and Explanation:
1. To create new partition use :
# fdisk /dev/hda
2. Type "n"  For New partition
3. It will ask for Logical or Primary Partitions. Press l for logical.
4. It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.
5. Type the Size: +100M , you can Specify either Last cylinder of Size here.
6. Press "p" to verify the partitions lists and remember the partitions name.
Default System ID is 83 that means Linux Native.
7. Type "t" to change the System ID of partition.
8. Type Partition Number
9. Type 82 that means Linux Swap.
10. Press "w" to write on partitions table.
11. Either Reboot the System.
12. To create Swap File system on partition.
# mkswap /dev/hda?
13. To enable the Swap space from partition.
# swapon /dev/hda?
14. Verify Either Swap is enabled or not.
# free -m 
15. # vi /etc/fstab
/dev/hda? swap swap defaults 0 0
16. Reboot the System and verify that swap is automatically enabled or not.

QUESTION NO : 8
There is one partition named /dev/hda14 mounted on /data. The owner of /data is
root user and root group. And Permission is full to owner user, read and execute to
group member and no permission to others. Now you should give the full permission
to user user1 without changing pervious permission.

Answer and Explanation:

We know that every files /directories are owned by certain user and certain
group, And Permissions are defines to owner user, owner group and other.
-rwxr-x--- : Full permission to owner user, read and write to owner group and
no permission to others.

 According to question : We should give the full permission to user user1 without
changing the previous permission. With ACL (Access Control List) we can give certain permission to certain user and certain group
without changing previous permission. But that partition should mount using acl
option. Follow the steps
1. vi /etc/fstab
/dev/hda14 /data ext3 defaults,acl 0 0
2. # mount –o remount /data
3. # setfacl -m u:user1:rwx /data
4. Verify using: # getfacl /data

QUESTION NO : 9
One Logical Volume is created named as myvol under vo volume group and is
mounted. The Initial Size of that Logical Volume is 124MB. Make successfully that
the size of Logical Volume 245MB without losing any data. The size of logical
volume 240MB to 255MB will be acceptable.

Answer and Explanation:

1. First check the size of Logical Volume: # lvdisplay /dev/vo/myvol2. Increase the Size of Logical Volume: # lvextend -L+121M /dev/vo/myvol3. Make Available the size on online: # resize2fs /dev/vo/myvol4. Verify the Size of Logical Volume: # lvdisplay /dev/vo/myvol5. Verify that the size comes in online or not: # df -h

QUESTION NO : 10
Create the user named user1, user2, user3 and make them  to 'training' secondary group.

Answer and Explanation:
1. # groupadd training 2. # useradd -G training -u user1 3. # useradd -G training -u user2 4. # useradd -G training -u user3
QUESTION NO : 11
Change the Group Owner of /data to 'training' group and whenever user creates the file on /data make automatically owner group is training.

Answer and Explanation
There is one Special Permission SGID bit on Directory. Whenever you set the SGID
bit on directory,When users creates the file/directory automatically owner group
will be same as a parent.

1. # chgrp training /data 2. # chmod g+s /data
QUESTION NO : 12
Make sure on /data that only the owner user can removes files/directories.

Answer and Explanation:
By default user1 can remove user2’s files due to directory permission to group
member. We can prevent of deleting files from others users using Sticky Bits.

1. # chmod o+t /data
2. Verify /data: # ls -ld /data
You will get: drwxrwx-T

QUESTION NO : 13
One New Kernel is released named kernel-hugemem. Kernel is available on
ftp://server1.example.com under pub directory for anonymous. Install the Kernel
and make previous new kernel is default to boot System.

Answer and Explanation
1. # rpm -ivh ftp://server1.example.com/pub/kernel-hugemem-* 2. # vim /etc/grub.conf
Set the default to new kernel
default=0
Example of /etc/grub.conf

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux ES (3.12.ELhugemem)
    root (hd0,0)
    kernel /vmlinuz-3.12.ELhugemem ro root=LABEL=/1 rhgb quiet
    initrd /initrd-3.12.ELhugemem.img
title Red Hat Enterprise Linux ES (2.6.9-5.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/1 rhgb quiet
    initrd /initrd-2.6.9-5.EL.img

rpm command is used to install, update and remove the rpm package. -ivh option is
install, verbose, and display the hash mark.

QUESTION NO : 14
Add a job on Cron for 'natasha' user  to display Hello World on every two Seconds.

Answer and Explanation
 # crontab -u natasha -e

*/2 * * * * /bin/echo “Hello World”

Note * means every. To execute the command on every two minutes */2.
To List the Cron Shedule: crontab –l
To Edit the Schedule: crontab –e
To Remove the Schedule: crontab –r

 QUESTION NO : 15

By Default Scheduling on Cron allowed to all users. Deny to all users except root to
run cron schedule.

Answer : 15
# vi /etc/cron.allow root

QUESTION NO : 16 

Find the files owned by 'fabrice', and copy it to catalog: /opt/dir


Answer : 16


# mkdir -p /opt/dir
# find / -user harry ­exec cp ­rfp {} /opt/dir/ \;


QUESTION NO : 17

Find the rows that contain abcde from file /etc/testfile, and write it to the file/tmp/datatfile, and the sequenceis requested as the same as /etc/testfile.

Answer : 17


# grep "abcde" /etc/testfile > /tmp/datafile

QUESTION NO : 18

Configure the verification mode of your host account and the password as LDAP. And it can ldapuser40. the password is set as "password". And the certificate login successfully through
can be downloaded from http://ip/dir/ldap.crt. After the user logs on , the user has no host directory unless you configure the autofs in the following questions.

Answer : 18
 

# system-config-authentication

1. User Account Database: LDAP
2. LDAP Search Base DN: dc=example,dc=com
3. LDAP Server: ldap://instructor.example.com (In domain form, not write IP)
4. Download CA Certificate
5. Authentication Method: LDAP password
6. Apply

# getent passwd ldapuser40


QUESTION NO : 19

Configure autofs to make sure after login successfully, it has the home directory autofs, which is shared as /rhome/ldapuser40 at the ip: 172.24.40.10. and it also requires that, other ldap users can use the home directory normally.

Answer : 19

# chkconfig autofs on
# cd /etc/
# vim /etc/auto.master
/rhome /etc/auto.ldap
# cp auto.misc auto.ldap
# vim auto.ladp
ldapuser40 -rw 172.24.40.10:/rhome/ldapuser40
* -rw 172.16.40.10:/rhome/&
# service autofs stop
# server autofs start
# showmount ­e 172.24.40.10
# su - ladpuser40


QUESTION NO : 20

Configure the system synchronous as www.redhat.com.

Answer : 20


Graphical Interfaces:
System-->Administration-->Date & Time

OR

# system-config-date
 
Fuente: http://linux--news.blogspot.com/2013/12/rhctrhcsa-exam-notes.html

No hay comentarios:

Publicar un comentario