RHCE Administration II Book Moamen Hany
RHCE Administration II Book Moamen Hany
RHCE ~
F
N P
L
Welcome in
Contents F
N P
L
Copyright
Unit1:Introducation
Unit2:Startup and Shutdown
Unit3:System Administration Tools
Unit4:Packaging Tools
Unit5:File System
Unit6:Rescue Mode RH 135 - Red Hat Administration II
Unit7:Partitioning and Disk Management
Unit8:Kernel
Unit9:Memory Management
Unit10:Sheduling
Unit11:Backup and Restore
Unit12:User Administration
Unit13:User Level Security
Unit14:Special Permission
F
N P
L
Unit1:
Introduction
o RHCSA Overview
o Book Overview
o Copyright
o Course Requirements
RHCSA Overview
http://www.redhat.com/training/certifications/rhcsa/
RHCE Overview
http://www.redhat.com/training/certifications/rhce/
Book Overview
Copyright
Course Requirements
F
N P
L
Unit2:
Startup and Shutdown
Boot Loader
GRUB LILO
Grand Unified Boot loader Linux Loader
init
Lab :
# init 0 shutdown system
# init 5 go to GUI
# init 3 Multi Mode
# init 6 reboot system
init
# vi /etc/inittab
# ls l /etc/rc.d/rc3.d
# chkconfig --list
# chkconfig atd on
# chkconfig --level 35 atd on
# chkconfig --level 35 atd off
# chkconfig --list atd
# chkconfig --level 12356 atd reset
# chkconfig --level 12356 atd | grep :on
# chkconfig --level 12356 atd | grep :off
# chkconfig --del atd
# chkconfig --add atd
# /etc/init.d/servicename (start,stop,restart,status)
# service --status-all
F
N P
L
Unit3:
System Administration Tools
o Configure a printer
Bash Initialization
/etc/profile Contain system administrator processes
$ HOME/.bash_profile Contain User processes
$ HOME/.bash_login Contain Login User Configuration
$ HOME/.profile
$ HOME/.bash_logout Contain Logout User Configuration
$ HOME/.bash_history Save all Command history.
$ HOME/.bashrc Contain Alias Command
# cat .bash_history
# setup
# system-config-<press tab>
# rpm i packagename
# rpm ivh packagename install package with show information and progress
# rpm Uvh Packagename upgradeing with show info and progress
# rpm q packagename Quarry about packagename
http://localhost:631
# system-config-soundcard
F
N P
L
Unit4:
Packaging Tools
o Installing Package
o Using YUM
Install
README
# rpm i packagename
# rpm ivh packagename install package with show information and progress
# rpm Uvh Packagename upgradeing with show info and progress
# rpm q packagename Quarry about packagename
To update system. Update of the system with all the dependencies that are necessary:
# yum update
Searches. To make a search of some package or term in the data base in some of the
formed deposits yum in the system:
# yum search any-package
The following thing will list all the packages installed in the system:
# yum list installed|less
The following thing will list all the packages installed in the system and that can (they
must) be updated:
# yum list updates|less
# cat /etc/yum.repos.d/rhel-source.repo
# cat /etc/yum.repos.d/centos-base.repo
F
N P
L
Unit5:
File System
o H.D Blocks
o Using Quota
Ext2
Ext3
Ext4
Data
Block
# ls i
# fdisk /dev/sda
m for help
# mkfs.ext3 -j /dev/sdb8
Temporary :
# mkdir /mnt/mydata
2- Mount partition
Permit:
# vi /etc/fstab
:wq
# df -h
# mount -l
# vi /etc/fstab
:wq
2- Remount partition
# touch /mnt/mydata/quota.user
# touch /mnt/mydata/quota.group
5- Set quota
user
# edquota -u username
F
N P
L
Unit6:
Rescue Mode
To boot your system in rescue mode, boot off of a Red Hat Linux boot disk
or Red Hat Linux CD-ROM , and enter the following command at the
installation boot prompt:
F
N P
L
Unit7:
Partitioning and Disk Management
o LVM
o RAID Level
Volume Group
Physical Volume Physical Volume
(VG)
(PV) (PV)
sda sdb
Logical Volume
PE PE PE PE
(LV)
PE PE PE PE
# disk /dev/sd**
# mke2s -j /dev/sd**
# pvcreate /dev/sd**
4-Extend PV to you VG
# vgextend <vgname> /dev/sdb7
Spanned
sda sdb
Fault Tolerance: Good. Can tolerate loss of one drive, none sda sdb sdc
parity. P 1 1
2 2 2
Random Read Performance: Very good to excellent. 3 3 3
Implementing RAID :-
Lab:
# fdisk /dev/sdb
# m for help menu
Mount {md*}
# mkdir /mnt/raid0
Test
# mount
# df -h
F
N P
L
Unit8:
Kernel
o Kernel Concept
o Kernel Modules
o kernel Compilation
http://www.kernel.org/
Modules are pieces of code that can be loaded and unloaded into the kernel upon demand.
They extend the functionality of the kernel without the need to reboot the system. For
example, one type of module is the device driver, which allows the kernel to access hardware
connected to the system.
Dynamic Static
Modules Modules
From SLES distribution: use rpm to install the kernel sources package
# rpm -ivh kernel-source-version.rpm
# make clean
Cleans up old .o, .a files, and so forth
# make dep
Checks dependencies
# make bzImage
Compiles kernel
May take 5-60 minutes
Creates kernel image (bzImage) in
/usr/src/linux-<VERSION>/arch/<CPUTYPE>/boot
# make modules
Compiles modules
May take 2-60 minutes
Can be combined:
# make clean dep bzImage modules
Reboot System
# init 6
F
N P
L
Unit9:
Memory Management
F
N P
L
Unit10:
Scheduling
o Use crontab
o Use anacron
o Use the at
Note: /etc/crontab
If Server shutdown before
run cron task and turn on
after cron schedule , task
passive in this case.
# vi /var/spool/anacron/filename
# at 4am
>date
>ls -l
<ctrl+d>
Or
# at 19:22
F
N P
L
Unit11:
Backup and Restore
o Backup Schemes
o Backup Devices
Full backup
Preserves the whole system
System backup
Preserves system directories and files
Must include backup/restore tools
Usually on bootable media (floppy, CD-Writable)
Data backup
Preserves user data
Incremental or differential backup
Only backup files that changed
Very fast, but takes more time to restore
Must be used carefully
Needs more media
Tape drive
Network (SAN)
tar
Backs up individual files
Widely available
Excellent for transferring data between platforms
cpio
Backs up individual files
Widely available
Difficulties with many symbolic links
dump
Backs up whole filesystems
Can handle incremental backups (9 levels)
F
N P
L
Unit12:
User Administration
o Change Owner
root
Super User
File permissions do not apply for root
Can do anything except the obvious
Account for the system administrator
Groups
A group is a set of users, all of whom need access to a given set of
files
Every user is a member of at least one group and can be a member
of several groups
Primary group: used for file/directory creation
Group set: used to determine access permissions
The user has access to files in all of the groups in its groupset.
/etc/login.defs
/etc/shadow
/etc/gshadow
/etc/passwd
/etc/shadow
/etc/group
Userneme:Encpassword:UID:GID:Comment:HomeDir:ShellType
Create a group:
# groupadd hrgroup
Delete a group:
# groupdel hrgroup
Userneme:Encpassword:UID:GID:Comment:HomeDir:ShellType
1) Login name
2) Encrypted password (md5)
3) Last change of credentials (days since Jan 1, 1970)
4) Days before password may be changed
5) Days after which password must be changed
6) Days before password is to expire that user is warned
7) Days after password expires that account is disabled
8) Days since Jan 1, 1970 that account is disabled
# Ls -a /etc/skel/.
# ls -l
F
N P
L
Unit13:
User Level Security
o Security Logs
o UserFul Command
Notes:
/var/log/lastlog
Records the last time a user logged in. This file can be examined with the lastlog
command.
/var/log/messages
This is the general log file. Most applications and daemons will write log information to this
file. The messages file is an ASCII file which can be viewed with tail -f or more.
/var/log/secure
Keeps track of the failed login attempts. Use more /var/log/secure to view the contents of
this file.
/var/log/wtmp
All successful logins are saved in this file. This file can also be examined with the who
command. Another tool for viewing this file is the last command.
/var/run/umtp
Logs the users currently logged in the system. The default output of the who command is
the contents of this file.
Allows users to execute specific commands another user without requiring that
users password
/etc/sudoers file list which users are allowed to execute which commands on
which host as which user Edit this file with visudo only or ( vi /etc/sudores ) .
# vi /etc/sudores
User1 ALL=/sbin/fdisk
User1 ALL=/sbin/useradd
:wq
$ sudo /sbin/fdisk -l
F
N P
L
Unit14:
Special Permission
Authentication: Verifying that you are who you say you are
Can be based on:
Something you only know (for example, password, PIN)
Something you only have (for example, smartcard, token, key)
Something you only are (for example, fingerprints, retina scan)
# cat /etc/pam.d/login
Such as
# ls -l /bin/su
# mkdir momendata
# chmod 775 momendata
# groupadd sales
# usermod -G sales momen
# chown momen:sales momendata
# chmod u+s,g+s,o+t momendata
# ls -l
??
Last Viewed
Copyright May 2012 ,
Engineer Momen Hany Mohamed