Installation
Installation
Red hat Enterprise Linux is available for the Intel x86, Intel Itanium2, AMD64, IBM eServer
zSeries, and IBM eServer iSeries.
Recommended Hardware Specifications:
Installation Types
1. Graphical
2. Text
More Bhushan
/boot/grub/grub.conf
timeout=5
splashimage=(hd0,0)/grub/splash.xpm
hiddenmenu
password --md5 $1$ / dfhadshhg324j3hefyffh
default=0
title Red Hat Enterprise Linux
root (hd0.0)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-8.el5.img
title Windows
rootnoverify (hd0,1)
chainloader +1
2
More Bhushan
RUNLEVELS: - The Runlevel is nothing but the different type ode available to load the kernel.
The run level is selected by either,
the default in /etc/inittab at boot
passing argument from the boot loader
using the command init new runlevel
To check the current runlevel we have command runlevel.
The following the chart details about the run levels that Linux has by defaults: -
Halt or shutdown
Officially undefined
Reboot
More Bhushan
More Bhushan
The Linux kernel is the heart of linux operating system. It is the kernels responsibility to
control hardware, enforce security and allocate resources such as CPU and RAM.
Kernel information and configuration: /sys file system
/proc file system
dmesg
/boot/grub/grub.conf
FILESYSTEM MANAGEMENT
5
More Bhushan
/
/boot
/dev/pts
/dev/shm
/proc
/sys
swap
/dev/hda5
/new
ext3
ext3
devpts
tmpfs
proc
sysfs
swap
defaults
defaults
gid=5,mode=620
defaults
defaults
defaults
defaults
ext3
1
1
0
0
0
0
0
1
2
0
0
0
0
0
defaults
0 0
9. init 6 or reboot
NETWORK CONFIGURATION
Some commands,
ifconfig
mii-tool
hostname
system-config-network
route
ethtool
More Bhushan
1. DHCP
system-config-network
use dhcp
service network restart
ifconfig
2. DNS
hostname
ifconfig
vim /etc/resolv.conf
add entries as follows,
search
<domain name>
like example.com
nameserver <IP Address of DNS server> like 192.168.0.254
service network restart
nslookup
>example.com
>192.168.0.254
3. FTP or HTTP
elinks: -test web browser
fire fox: -GUI web browser
4. Samba
smbclient -L <server IP or hostname> -U <username>
smbclient //<server IP or hostname> -U <username>
PACKAGE MAINTAINS: 7
More Bhushan
As per the requirement we have to add some applications, servers, etc. for that we have two
methods in RHEL5.
1. RPM (Red hat Package Manager): - the rpm command is used for the installation of
packages which can be installed on your system.
rpm
<operation>
Ex,
rpm ivh /opt/Server/rpm -ivh bind-9.3.3-7.el5.i386.rpm
<operations>
-i
-v
-h
-q
-a
--import
--aid
--force
--nodeps
install
verbose
hashes
query
all
import keys
to automatically install the dependcies
forcefully
Without dependcies
2. YUM (Yellow Update Modifier): - As the rpm command was failed to resolve the
dependcies the red hat people decided to search another solution which was the YUM.
Also with the help of yum, you do not require to copy the packages on each and every
computer. You can share your database with the help of ftp or http protocol.
Configuration: 1. insert the Linux DVD
2. mount /dev/cdrom /opt
3. mkdir p /var/ftp/pub
4. cp rf /opt/* /var/ftp/pub
5. vim /etc/yum.repos.d/server1.repo
[Server]
name=station1
baseurl=file:///var/ftp/pub or baseurl=ftp://192.168.0.1/pub
enabled=1
gpgcheck=0
6. rpm ivh /var/ftp/pub/Server/createrepo-0.44-2.fc6.noarch.rpm
7. createrepo -v /var/ftp/pub
8. yum list
*note
yum install <package name>
yum update <package name>
ADVANCE USER MANAGEMENT
8
More Bhushan
<username>
More Bhushan
Normally processes started by a user under the user & group security context of that user. SUID
and/or SGID bits set on an excutable file cause it to run under the user and/or group security
context of the files owner and/or group.
To set a SUID,
chmod u+s <filename>
To set a SGID,To set the group owner for the subcontent of the directory.
chmod g+s <filename>
Sticky bit
Normally users with write permissions directory can delete any file in that directory regardless of
that files permissions or ownership. With sticky bit set on a directory, only the owner of a file
can delete the file.
Setgid access mode
Normally,
files created in a directory belong to the default group of the user. When a file
created in a directory with the setgid bit set, it belong to the same group as the directory.
Access Control List (ACL): The ext3 filesystem includes support for access control lists which allow finer
grained control of filesystem permissions that are possible with the standard three access
categories that are normally provided.
To view the ACLs for a file, use the command: getfacl <filename with location>
To set the ACLs for a file, use the command: setfacl -m u:<username>:<permissions>
<filename with location>
setfacl -m g:<groupname>:<permissions> <filename with location>
To remove the ACLs
setfacl -x u:<username> <filename with location>
SELINUX (SECURITY ENHANCED LINUX) : Security enhanced Linux (SELinux) has been around for some time, but has recently seen a rise
in popularity. It was developed by National Security Agency (NSA), as a research project.
10
More Bhushan
Linux was selected because it is open source and therefore easier to get people involved. It also
makes it easier to prove the technology.
The primary goal of SELinux was to protect user-space from system-space & protect user data
from system services.
With SELinux they introduced a concept called Mandatory Access Control (MAC). With MAC,
the security administrator decides who can do what to which files.
SELinux installation options : During the installation, SELinux is automatically activated.
Disabled: -This option turn of the SELinux features
Permissive: - This option sets up some default policies & logging
Enforcing: -SELinux is now enforced, but it will affect certain daemons.
Each process or object (file, directory, network socket also has a SELinux context.)
Like,
Identity:role:domain/type
root:object_r:user_home_t
Controlling SELinux : To control SELinux,
a. system-config-securitylevel
b. vim /etc/sysconfig/selinux
SELinux Contexts
List process contexts ps Z
List file contexts
ls -Z
Change the contexts
chcon
Troubleshooting SELinux
What is the error? Check /var/log/messages
Is the process doing something it shouldnt
Does the target have the right context
ADVANCE FILESYSTEM MANAGEMENT: RAID: Redudunt Array of Independent Disk. RAID has different levels
11
More Bhushan
RAID Level
0 (Striping)
1 (Mirroring)
Minimum hard-disk
Maximum hard-disk
Read Performance
Write Performance
Disk Utilization
Fault tolerence
Coasting
2
32
High
High
100%
0%
Less
2
32
High
Low
50%
Maximum
High
3
32
High
High
75%
75%
Moderate
More Bhushan
Logical volume
Volume Groups
Physical Volumes
Partitions
defaults
0 0
/dev/volA/lvm1
QUOTA
The Linux quota system allows an administrator to estalish limits on the amount of disk
13
More Bhushan
resources users can consume. Because resources accounting must occur with every file creatiion,
quotas are implemented within kernel.
Implementation: 1. Create one partition
2. mkdir /quota
3. mkfs.ext3 /dev/hda?
4. mount /dev/hda? /quota
5. vim /etc/fstab
add a entry
/dev/hda?
/quota
ext3
6. mount -o remount,usrquota,grpquota
defaults,usrquota,grpquota
/quota
user1
14
More Bhushan
MANUALLY UPGRADING THE KERNEL: The Red Hat Enterprise Linux Kernel is custom built by the RHEL kernel team to ensure its
integrity and compatibilty with supported hardware.RHEL kernel are packaged in RPM format
so that they are easy to upgrade and verify using the package management tool, or yum
command.
Overview of kernel-packages: kernel : Contains the kernel for multi-processor systems. For x86 system, only the first 4GB
of RAM is used.
kernel-devel: -Contains the kernel headers and makefiles sufficient to build module against the
kernel package.
kernel-PAE: - Contains the kernel for multi-processor systems. For x86 system, support for
over 4GB of RAM (up to 64GB).4GB/4GB split, 4GB of virtual address space for the kernel
and almost 4GB for each user process on x86 systems.
kernel-PAE-devel: - Contains the kernel headers and makefiles sufficient to build module
against the kernel-PAE package.
kernel-doc: -Contains documentation files from kernel source.Installation of these package
provides a reference to that options that can be passed to Linux kernel modules at load time.
kernel-headers: - Includes the C header files that specify the interface between the Linux
kernel and userspace libraries and programs.
kernel-xen: -Includes a version of the Linux kernel which is needed to run Virtulization.
kernel-xen-devel : - Contains the kernel headers and makefiles sufficient to build module
against the kernel-xen-devel package.
15
More Bhushan