Red Hat Enterprise Linux 4.


Unix is the first Operating system in the world, developed by Kem Thompson and Dennis Ritchie in 1969 at Bell Lab by AT&T Company IBM : AIX SGI : IRIX HP : HP Sun : Solaris FSF: Free software foundation organization, they start a project by name GNU. The mail aim of this project is to develop such a O.S that can run on any platform. In 1991, a student Linus Torvalds developed a kernel named Linus’s Kernel plus GNU application called Linux O.S Linux is a open source technology. Different companies that provide Linux in Market are Redhat, SuSe, Mandrake, Turbo, Knoppix etc.

Features and Advantage:
Features: a. Linux is the fastest Operating system in the world. It runs 2 to 3 times fast than windows O.S b. Linux is the very secured O.S because there is no any problem of virus. c. Linux file format is text format and windows file format is binary format. d. Linux is very reliable O.S because kernel of linux is very stable as compare to windows kernel not crashed easily. e. Kernel of linux is very small, it can be stored in floppy f. Linux uses the x-Window system which is advanced network windowing system. Using this system we can display output of any workstation monitor attached in the network Advantages of Linux: a. Virus Proof b. Crash Proof c. Economical d. Multiuser, multi desktop and multi tasking


Red Hat Enterprise Linux 4.0ES

Mode of Login There are two mode of login 1. Text Mode (Alt+ctrl+F1) 2. Graphical Mode (Alt+Ctrl+F7) In case of Text Mode Station2 Login : root Password : redhat [root@station2~]# to switch from one text mode to another Alt+Ctrl+F1 to Alt+Ctrl+F6 In case of Graphical Mode Ctrl+Alt+F7 Common Command Some of the Common system command are as follow: 1. Date : to display date and time 2. Cal : to display the calendar 3. Cal 11 2006 : display the calendar of Month 11 and year 2006 4. Clear : To clear the screen 5. ls : to list directory contents color identification blue : Directories White : Files Green : Executable files Red ; Zip files, rpm, tar file Different switches used with “ls” command ls –l or ll : used for long listing including file and directory permission (-) : file (d) : Directory (l) : Symbolic link ls –a : shows all hidden files and directory. Any file followed by (.) is hidden file ls –al : show all hidden files and directory with long listing or whole description ls –d : shows all the directory 6. pwd: Print working directory 7. who am I : display the information of current terminal 8. who : display all the terminal in a network 9. history : it shows all the command your have used.


Red Hat Enterprise Linux 4.0ES
By default history stores last 1000 command which u have run. If u want to change # vi /etc/profile HIST SIZE =10 Save and exit # history –c ( to clear all the previous command reside in history) Creating file and Directory: a. Creating file: The ‘cat’ command is used to create a file Syntax: # cat > filename example: # cat > abc.txt (Ctrl +D) is used to save the file. b. View the content of file Syntax: # cat filename Example: #cat abc.txt #cat –b abc.txt c. Creating Directory The ‘mkdir’ command is used to create directory Syntax: Mkdir [directory_name] Example: # mkdir raj Option used: cd : To change directory cd .. : To come out from directory cd : to jump to root directory cd - : to jump to previous directory Deleting Files and directory: Syntax: For file: rm <filename> example: rm abc.txt for directory syntax: rmdir <directory_name> Note: Only empty directory will be deleted) If we want to delete the tree structure of directory then we need to use the following command Syntax:


Red Hat Enterprise Linux 4.0ES
rm –rf <directory_name> where r = recursively f= force in order to remove non empty directory Syntax: rm –r <directory> example; rm –r raj this will remove directory step by step ,first remove sub directory and then finally main directory. Another method of creating file : Touch : this command is used to create a blank file with size zero. # touch <filename> Example: #touch abc Copying File and Directory: a. Copy file: Syntax: # cp [source]filename [destination] b. Copy directory #cp –r [source]directory [destination] to copy a directory into another directory recursively c. cp –rf [source]directory [destination] to copy a directory forcefully syntax used for copy file or directory: cp [option] file destination option: -I : interactive : ask before overwriting file -r : Recursive -p : Preserve -f : forcefully More than one file can be copied at a time if the destination is directory Syntax: cp [option] file1 file2 file 3 Destination Moving and Renaming File and Directory Syntax: # mv : move /rename files and directory


Red Hat Enterprise Linux 4.0ES
Example: # mv [option] file destination example: # mv t.txt /home/raj/ more than one file can be moved at a time if the destination is a directory # mv [option] file1 file2 file3 destination Getting Help: The command that are used to get the help are discussed as : a. Whatis Display a short description of command , it uses a database that is updated nightly. Often not available immediately after installation. Syntax: # Whatis cal b. Help Display usage summary and argument list Syntax: <command> --help Example: #Date –help c. Man and Info: Both provide documentation for command. Almost every command has a “man” page. Collection of pages are called linux manual. # man date # info date Viewing Text Page Syntax: #less [option] [filename] Example: # less abc.txt scroll with arrows/PgUp /PgDown /text : n : Option: -c : -s : search for text Next Match Clear before displaying Squeeze multiple blank lines into a single blank line

Simply we can also use “less” along with pipe | as # ll |less


0ES File and Directory: ‘ll’ is used to display the information about the files and directory including date. users.Red Hat Enterprise Linux 4. Four symbols are used when displaying permission. 6 . subhki2000@gmail. name and permission. size. R : Read W : Write X : Execute : no permission -rwxrwxrwx : files drwxrwxrwx : directory files and directory permission are symbolized by ten

7. +.= are + operator simply add the new permission with previous one and = assign the new permission while removing old (new permission overwrite an old) 2. subhki2000@gmail. 3. g-w.o-rw directory/file ugo+rwx file/directory ugo-rwx file/directory • + is used to add permission • . symbolic 2. 5. # # # # # # # chmod chmod chmod chmod chmod chmod chmod u+rwx file or directory : in case of user only ug+rwx file or directoty : in case of user and group u+w. then there are two methods: 1.o+x directory/file u+rw. u.g. Numeric Method: In this method.g=wx.txt permission : -r. 7 .r.chmod u=w.Red Hat Enterprise Linux 4..x 3.g.-r. Symbolic Method: Syntax: Chmod mode directory/filename Mode Option: 1. group get 7 means read/write/execute and ame for other # chmod 531 file/directory in this case user get 5 means that user has permission of read/execute. = 1.g+rw directory/file used remove permission chmod ugo=rw directory/file this command will assign read/write permission to u.txt this command will assign write to user. w.o suppose we have one file as test. group get 3 means write/execute and other get 1 means that other has permission to execute.o=w test. 2.4.g+r. 4. Numeric 1.o 2. The main difference between +. calculation are based on following numbers r=4 w=2 x=1 0= no permission Example: #chmod 777 file/directory in this case user get 7 means that user has permission of read/write/execute. write/execute to group and write to other while remove the previous permission.0ES If we want to change permission.

Red Hat Enterprise Linux 4. 8 .0ES #chmod 742 file/directory 7 : User : rwx 4 :Group : r 2 : Other : w Linux file system: Figure Root : Etc : server dev : home : proc : disk and it is an home directory of super user (root) administrator it is the location of all configuration file and directory used for configuration or system configuration it is a location of the device file it is a location of home directory or regular users it is a virtual file system or directory not actually store on the contain system information # cat /proc/meminfo # cat /proc/cpuinfo contain kernel and boot related files it is also a virtual directory and contain system information it is a mount point of removable disk like cdrom floppy usb drive boot : sys : media : etc.

com 9 . /dev/hdx Where x is a : /dev/hda : Primary master b : /dev/hdb : Primary slave c : /dev/hdc : Secondary master d : /dev/hdd : Secondary slave In case of SCSI.0ES tmp : usr : lib : bin : command sbin mnt opt var error : : : : it it it it contain all temporary file is used for software installation contain all library files is the location of all executable files or command or user /usr/bin also contain user command it contain all system command or super user command /usr/sbin it is a mount point for physical hard-disk or partition optional directory and used for temporary working it is a variable file system or directory and contain all log and message file system type: Dos : Fat 16 95/Xp/2000 : FAT32 Xp/NT/2000 : NTFS Linux : EXT2.EXT3 UNIX : VXFS Representation Of Media Devices: All the device file are stored in /dev/ Hard disk . Sata or USB we will use : /dev/sda CD-rom: /dev/cdrom /dev/cdrom1 /dev/cdrecorder Floppy: subhki2000@gmail.Red Hat Enterprise Linux 4.

vim Editor Vi is the standard file editor for Unix and Vim is the standard file editor for Linux For Red hat Linux vi and Vim both are same There are three mode of vi editor 1. Command mode is again divided into 3 mode a. # umount /media/floppy Mounting USB media 10 . undo subhki2000@gmail. paste. command mode 2. we can create or modify any file Vi. insert mode 3. Copy. Copy. paste delete. Cursor movement b. save and Exit Mode 1. Cursor Movement J : Down K : UP L : RIGHT H : LEFT b. Text search a.directed by the kernel as SCSI device /dev/sdax Vi Editor: Using vi . # umount /media/cdrom and then eject the cdrom in case of RHEL 4.Red Hat Enterprise Linux 4.0 we have to use command in order to unmount. delete.0ES /dev/fd0 /dev/fd1 to access partition of windows in linux #mount –t vfat /dev/hdax /mnt in order to check the label of any partition #e2label /dev/hdax where x is number Mounting CD Rom # mount –t auto /dev/hdc /media/cdrom -t : file type auto : file type in order to check where cdrom is attached we can open the file fstab #vi /etc/fstab now in case of RHEl 3.0 we simply type # eject Mounting Floppy #mount –t auto /dev/fd0 /media/floppy in case of floppy we have to umount first then only we remove floppy otherwise all content of floppy may be lost or floppy may be physically damaged. undo c.

service account 11 .o. Super User created automatically at the time of installation 2. Same is option mode start after one character mode start after one line mode start before one line and Exit : Quiet : forcely quiet : save and forcely quiet : save and exit User and Group Administrator There are three type of user account in Red hat Linux 1. Super user or Administrative account 2. a.0ES dd yy u p ndd nyy : : : : : : delete particular line copy particular line Undo paste n is the number of line to be deleted n is the number of line to be copied c.Red Hat Enterprise Linux 4. Text Search /text example /then 2. Regular user account 3. Save :q :q! :wq! :wq mode start at the point where cursor is. O i : insert used with insert a : insert o : insert O : insert 3. insert. Graphical method by using Red hat user manager utility a. Insert Mode Option I. Regular user Account. Using command line method ‘useradd’ or ‘adduser’ command b. a . # adduser user_name (Recommended : minimum 6 character used password) # passwd user_name Example: #adduser rakesh #passwd rakesh Now open the file /etc/passwd to check the entry of user in subhki2000@gmail.

com 12 . In order to check the shell available use /etc/shells # vi /etc/shells in order to get the information about the group we need /etc/group #vi /etc/group it contain four field 1.def # vi /etc/login. groupid of the user syntax: #id username #id rakesh subhki2000@gmail. home directory 7. When any user is created its default home directory is created inside /home /home/rakesh 7th field is login shell. Password 3. login shell password entry for each user will be stored in /etc/shadow # vi /etc/shadow now in order to check the Userid. Default shell for user is /bin/bash different shells are used ksh. GroupId 4. blank (User information field ) comment 6.S.0ES #vi /etc/passwd it contain 7 entry of each user 1. groupid automatically from /etc/login. csh. Member of group # finger user : this command is used to get the information about the Syntax: #finger username #finger rakesh #id : this command is used to get userid.zsh shell is an user interface between user and O. Group name 2. sh. groupid 5. linux command shell is a prompt that allow us to interact with our system by executing various command.def when any user account is created then user will get userid. password 3. userid 4. tcsh.def 5th field is used for user information or comment 6th field is used for home directory. Username 2.Red Hat Enterprise Linux 4. Group we use /etc/login.

change user login name #usermod –l newname oldname #usermod –l rajesh rakesh 7. adding group to the user #usermod –g g1 –G g2 rakesh 2. change Group id #groupmod –g 2005 group1 Redirecting Input /Output subhki2000@gmail. change home directory #usermod –d /rakesh-home rakesh –m 5. change comment #usermod –c rakeshsingh 13 . Change Group name #groupmod –n newname oldname #groupmod –n group1 g1 8.0ES Creating Group: Syntax: #groupadd groupname #groupadd –g gid groupname Example: #groupadd raj Exercise: Create a user that should have uid=1000 shell=sh description and home directory as /data Sol: #useradd –u 1000 –c rakeshpundir –s /bin/sh –d /data rakesh #passwd rakesh Grpahically System Setting :-> User & Group OR #system-config-user Every user have two group one is elementary group or primary group and secondary group -g : Primary Group -G : Secondary Group Creating Group #groupadd g1 #groupadd g2 Steps: 1. To change id of the user #usermod –u 1001 rakesh 3.Red Hat Enterprise Linux 4. change shell #usermod –s /bin/bash rakesh 6.

Similarly standard error. Common redirection operator > >> < 2> 2>> : : : : : command>file command>>file : command>file command2>file : command2>>file : : output command to file Append output of command to file : receive input from file error from command to file append Example: #find /etc –name passwd this command will search for all file name passwd in /etc and its subdirectories now we can redirtect the standard outpout #find /etc –name passwd > output output is a file where command output will be stored. We can display the link name and the referenced file by ‘ls –l’ #ls –l pf lrwxrwxrwx 1 root root pf->/etc/passwd file type: l for symbolic link the content of the symbolic link is the name of the file that is referenced Syntax: Ln –s filename [linkname] Example: Ln –s /etc/passwd password There are seven fundamental file type : regular file d : symbolic link b : block special file c : character special file p : named file subhki2000@gmail. which normally display on the terminal can be redirected into a file. redirect further standard error. which normally display on the terminal can be redirected into a file.0ES The standard Output of command . the existing file will be 14 .Red Hat Enterprise Linux 4. Standard error is still displayed on the screen #cat output If the target file of the file redirection with > already exists. To append data to an existing file use >> to redirect instead of > #find /etc –name passwd >> output Redirecting standard Error We can redirect standard error with 2> #find /etc –name passwd 2>errorfile standard output is displayed on the screen . appending to the same file with 2>> #find /etc/ -name passwd 2>>errorfile #cat errorfile Symbolic links: A symbolic link point to another file.

0ES s : socket character special file are used to communicate with hardware one character at a time. df b. Checking Free Space: In order to check the free and usage space per file system and directory and each sub directory we have two command a. If we have command that run often. disk space used . Default root’s umask is 022. this means that anyone on the system will have read and write access to any file. disk space free #df –h -h : used multipliers such as G or M for gigabytes and Megabytes The ‘du’ command reports the number of kilobytes contained by the items within a directory #du –s #du –h -s : used to request only the summary directory information #du –s /etc Aliases: Aliases are shortcut names for large commands. Alias c=clear We can make a permanent entry of alias in . but take a considerable amount of typing.Red Hat Enterprise Linux 4. 2048 bytes ls –l /dev |less { to check c and b files} named pipe type of file that passes data between processes. umask is used to withhold permission.bashrc file Type: #vi . A umask of 002 will result in file created with 664 permission and directory with permission 775. It report total disk space . It stores no data itself socket file are used for inter process communication. 1024 bytes. only file created will have 666 permission and directory will have 777. we can reduce these to an aliases. du the ‘df’ command reports on a per file system basis. logging back and type the following #alias #c Default Permission: The default permission for files is 666 and directory is 15 . Default umask on Red hat enterprise linux is 002. without a umask in effect. to change subhki2000@gmail. Block special file is used to communicate with hardware a block of data at a time : 512 bytes.bashrc alias c=`clear` save and exit Test your change by logging out.

0ES #umask 022 umask is typically set by script run at login time. Run Level: To check the run level we need to see the file /etc/inittab #vi /etc/inittab defaults run – level used by RHS are 0 : hault ( do not set init default to this) 1 : single user mode 2 : multi user mode without networking 3 : multi-user mode with networking 4 : unused 5 : X11 (Graphical) 6 : reboot #runlevel present : this command shows that in which run level you are at in init 3 16 .Red Hat Enterprise Linux 4. but we van increase or decrease the number of text mode simply by editing the file /etc/inittab #vi /etc/inittab line No 18 : id:5:initdefault (we can change this value from 1 to 5 as per our need) Line No 44 : 1:2345:respawn:/sbin/mingetty tty1 subhki2000@gmail. The next time you lig in umask will be set bask to your default unless you add command to one of your startup files such as .bashrc. if you type command startx to go to the graphical mode then it will not ask you for password. By default we have 6 virtual console (text mode).

. GNOME Application 1. Note: While installation we have to make sure that firewall option should be disable 1.5 to 2 times more than RAM Size) to check the RAM size do the following step Ctrl+alt+f7 Then type the following #cat /proc/meminfo this command will display the size and other information regarding RAM Ctrl+Alt+F7 to return to the installation mode. 17 . For adding 7:2345:respawn:/sbin/mingetty tty7 after editing this file we need to sane and exit #init q : this command is used to activate the change made. 6:2345:respawn:/sbin/mingetty tty6 in these line if we add one more line the number of virtual console increase and if we remove one line . Text Based Internet Server subhki2000@gmail. X Window 2.Red Hat Enterprise Linux 4. Desktop 1. Text Editor 2.0ES 2:2345:respawn:/sbin/mingetty tty2 . virtual console terminal decrease. Graphical Internet 3. NFS. Selinux disable Following Package are needed at the time of installation. FTP Partition type and its size / 10000MB /boot 128MB /home 1000MB swap 256 MB ( 1. Welcome Message at the time of login: We need to edit the file /etc/motd #vi /etc/motd type any message which we want to display “WELCOME TO ICON” save and exit INSTALLATION: Installation can be done either by CDROM . . No firewall 2.

168.and 4) inside /var/ftp/pub/RedHat/RPMS/ Now we need to configure the exports file.255.255.0. 6. #vi /etc/exports /var/ftp/pub 192. 2.0(rw.sync) save and exit now start the service #service portmap restart #chkconfig portmap on #service nfs restart #chkconfig nfs on Now Boot the new system from disk 1 of Redhat linux and type Linux askmethod Choose language : English Keyboard Type : U.6…… Now copy the disk 1 of the Redhat linux into the folder “/var/ftp/pub” Now copy RPMS of remaining CD’s (Disk 2.0ES 1.3.S Installation Method : FTP subhki2000@gmail. 7.Red Hat Enterprise Linux 4. 5.0 WS with the help of NFS and FTP. 18 . nfs : nfs-utils-1.0/255.254 NFS Dierctory : /var/ftp/pub And continue the installation There is slightly change in case of FTP In case of FTP: Boot the system from disk 1 of redhat linux and type Linux askmethod Choose language : English Keyboard Type : U. System 1.0.0. 3.168.S Installation Method : NFS Image NFS Server name : 192.1…….0. we have to perform the following step First we have to check the rpm of ftp/nfs ftp : vsftp-2. 3. 2. Server configuration tools Web Server Mail server DNS server FTP Server Network Server Legacy Network Server ( in this select Telnet) Administrative Tools System tools Printing tools 6132MB 681 MB Max Space Needed : Min Space Needed : While Installing Redhat linux 4.

0ES Then first mentioned your system ip address in order to identify itself in network 192.cfg And continue the installation subhki2000@gmail.255.sync) /var/ftp/pub 192.0.168. set the language.0. network.0 then mentioned the FTP server address as 192.168.0/255.cfg by editing one line Selinux-disable Now we have to configure the file /etc/exports #vi /etc/exports /root 192.sync) Now start the service #service portmap restart #chkconfig portmap on #Service nfs restart #chkconfig nfs on #service dhcpd restart #chkconfig dhcpd on Now boot the new system by Disk 1 of RedHat linux And type Linux ks=nfs:192.255.0(rw.0.255.0/255.168.254 255.255.254:/root/nfsks. keyboard type.168.255.0(rw.24 255.0.255.Red Hat Enterprise Linux 4. package 19 . installation type etc.cfg under /root Suppose we use NFS type then we have to mentioned NFS Ip address : 192.255. root password. Before making kick start file we need to check the rpm Rpm : system-config-kickstart Kick start consist of installation wizard which we can configured for another system like general information.254 Path : /var/ftp/pub Now we have to edit the file nfsks.0. then save the kick start with any name say nfsks.0 mount point : pub ( as in case of FTP the default path is /var/ftp) and continue the installation Kick Start Kick start is one of the automatic installation method.168.255.

i386.3-8. Like 20 .rpm To install RPM: #rpm –i rpm_name To Remove RPM #rpm –e rpm_name In order to remove those package which has dependency #rpm –e rpm_name –nodeps Switches used with RPM -i or --install -e or --erase -U or--Upgrade -F or --Freshen we can install rpm by using #rpm –ivh rpm_name -I : Install -v : Verbose -h : Human view (Hash Sign) To Upgrade RPM: #rpm –U rpm_name To repair any corrupted rpm package #rpm –F rpm_name subhki2000@gmail.0ES RPM (RedHat Package Manager) RPM package contain the file and directories associated with specific application and program.Red Hat Enterprise Linux 4. RPM namegenerally includes version. release and architecture for which it was build.

0ES To make any rpm query #rpm –q rpm_name To check all rpm of related pacakes #rpm –qa |grep rpm_name To check particular file associated with which rpm # rpm –qf /etc/passwd passwd file is associated with setup-2. crontab syntax: #at time at>command I at>command II ctrl+D Example: #at 10:30 at>eject at>eject –t ctrl+D Option used subhki2000@gmail. #rpm –qi rpm_name To Install any rpm forely #rpm –ivh rpm_name –force Installing dependent packages: Suppose we have 4 rpm’s r1.r3 and r4 . at b. we need to install r4 but r4 depends on remaining rpm’s then we use this command. To get the information about the particular 21 . To check any rpm’s query #rpm –qa “sendmail*” To check rpm’s of related service #rpm –qa |grep bind Task Automation and Task Scheduling It is used to perform the task at particular time Two command are used a.5 rpm To check the rpm containing which file #rpm –ql rpm_name this command will list all the file associated with particular rpm.Red Hat Enterprise Linux 4.r2.

We can also make the entry as 35 10 * * * eject 36 10 * * * eject –t In this case.deny inside this file we have to just mentioned the name of the user in order to restrict him not to use ‘at’ command. Once we create this file. Entry will be done by the root. We can also create a file ‘at. These two jobs will be performed at 10:35 in every month.deny’ is default in system. Syntax: ( By root login) #crontab –e six field are listed 1 2 minute hour command Example: 35 36 10 10 3 day of month 31 31 0-59 1-31 4 Month 5 day of Week 6 05 05 3 3 eject eject –t Minute : Hours : 0-23 Day of Month : Month : 1-12 Day of Week : 0-7 0 and 7 are Sunday #service crond restart #Whereis eject this command display the path of the 22 . #vi /etc/at. It is better to use the full path of the command inside crontab instead of just the name of the command. Another method is to make an entry inside the ‘crontab’ file.allow’ will allow to use the ‘at’ command. Just save and exit form the file By default all users are allowed to use ‘at’ command. subhki2000@gmail.0ES #at now #at now+5 minutes #at now+5 hours #at now+5 days #at tomorrow #at 10:30 july 16 2006 we can also restrict the user not to use the ‘at’ command. Difference between these two method is crontab is used to perform the same task many times whereas job through ‘at’ command will be removed after the task has been performed. Restriction will be provided by root login with administrator. now by default all users will be restricted to use ‘at’ command and only that user which have entry on ‘at.Red Hat Enterprise Linux 4.allow’ file. ‘at.

#atq : list the job number scheduled in at #atrm jobno : to remove any job subhki2000@gmail.Red Hat Enterprise Linux 4.0ES Some command which are executed with ‘at’ or ‘crontab’ send their output to the user mail box. #mutt This command will open the mailbox from where we check the output Some of the switched used with the ‘crontab’ #crontab –l List out all the job scheduled in crontab. These command are executed on background and their output is transferred to the particular user’s mail 23 . #crontab –r Can remove the job from the crontab. In order to see the output of the command we use.

Red Hat Enterprise Linux 4.ext3 /dev/hdax Where x is the number of partition that is newly created Now we mount this partition #mkdir /partx #mount –t ext3 /dev/hdax /partx Or #mount /dev/hdax /partx To mount this partition permanently make the entry in fstab #vi /etc/fstab /dev/hdax /partx ext3 defaults 12 24 .) : +100M Command (m for help) : w # partprobe ( to update the partition table without restarting the computer) Now we need to format the partition #mkfs.0ES Fdisk: Representation of Hard disk /dev/hdx /dev/hda : Primary Master /dev/hdb : Primary Slave /dev/hdc : Secondary Master /dev/hdd : Secondary slave Fdisk command is used to create a partition #fdisk –l Display the partition Listing Creating Partition #fdisk /dev/had Press(m for help): m Some important switches are D : delete partition N : New L : listing Q : quit W : Save and Exit T : changed type Press : n l: Logical (5 or above) p: Logical partition( 1-4) Type l First cylinder (Take as default): Press Enter Last Cylinder or +size or +sizeM or +sizeK (….

first make an empty file #touch /swp 25 . we need to make the entry in /etc/ec. Format the partition say /dev/hda9 #mkswap /dev/hda9 iii.local # vi /etc/rc.local Make the following entry Swapon /swp Save and exit subhki2000@gmail. creating partition b. Format the newly created swap file #mkswap /swp iv. Creating file i. Creating Partition: i. Active the swap file #swapon /swp To check the entry of swap file #cat /proc/swaps If we want that automatically this swap file activate .Red Hat Enterprise Linux 4. Creating file A. There are two method of doing so a. at that time we need to increase the size of swap partition as per the increased size of the RAM.0ES Increasing the Size of Swap Partition There are possibilities that any time we can increase the size of RAM. to check the entry of swap partition # cat /proc/swaps If we want to make the permanent entry in fstab then #vi /etc/fstab /dev/hda9 swap swap defaults 0 0 B. Now we customize the size of the swap # dd if=/dev/zero of=/swp bs=1M count=200 iii. save and exit and then run the command “partprobe” ii. We have to create one partition of size say 200MB and change its type to 82 (swap type) . Make the swap partition active #swapon /dev/hda9 iv.

3. Steps 1. Remount the home partrition # mount –o remount /home Where –o I used to active comma separator used in fstab After given a quota we must remount the directory with user quota or if we restart the system .0ES User Quota: Monitoring and controlling disk space usage is another important part of a system administrator tasks. 3M and 4M /dev/hda2 25 3000 4000 9 0 0 Block and inode has a grace period of 7 days ( by default) We can set the quota either by setting blocks soft and hard limit of inode ( Number of maximum file created) 26 . it automatically remount. Now check the /home #cd /home #ls File aquota. Now add quota for particular user # edquota –u username Output of this command File System Block soft hard inode soft hard /dev/hda2 24 0 0 9 0 0 1 block=1Kbyte Suppose we set the userquota by block size i.user will created) 5.e we set the soft limit to 3000 and Hard limit to 4000 i.Red Hat Enterprise Linux 4. Make the quota on subhki2000@gmail. Now check the mount quota # quotacheck –avum Where -a : Scan file system with quota enabled -v : Verbose mode -u : Scan for user quota -m : Remount file system with quota enabled 4.usrquota 1 2” 2. User quota is used to restrict the amount of disk space on each partition by each user.e. Edit the file /etc/fstab # vi /etc/fstab Search the following line “LABEL=/home /home etx3 defaults 1 2” Just add ‘usrquota’ after the word ‘defaults” as “LABEL=/home /home ext3 defaults.

#setquota -u username 2000 3000 20 25 /home LVM subhki2000@gmail. We can generate the quota information #repquota /home Note: We can generate the file of big size to check the quota Syntax: #dd if=/dev/zero of=bigfile bs=1M count=3 To check the quota for particular user after login #quota To set the grace period for particular user #edquota –T username To assign quota of one user to another user #edquota –p user1 user2 We can also set the quota for particular user by using following command.0ES # quotaon /home 27 .Red Hat Enterprise Linux 4.

Red Hat Enterprise Linux 4. we need to format #mkfs. /dev/hdax Figure /dev/hdax In order to create LV ( logical volume) we need to create a partition.ext3 /dev/vg00/lv00 Finally we mount it on /lvm #mkdir /lvm #mount /dev/vg00/lv00 /lvm Extending the size of LVM #lvextend –L+50M /dev/vg00/lv00 After adding we need to run ext2online command in order to assign file system type to the added size #ext2online /dev/vg00/lv00 Reducing the size of LVM 28 .0ES Logical Volume manager LVM is an extensible partitioning tool using which we can modify or resize any partition without changing our existing data. #fdisk /dev/had Press( m for Help): n l : logical p : Physical Type ‘l’ First Cylinder : Press Enter Last Cylinder (+sizeM or +sizeK) : +100M Command : t : t for change the type Partition no : x : x is the number of partititon Type : 8e : 8e for LVM Command : w #partprobe Now we create a Physical Volume (PV) #pvcreate /dev/hda8 Display the PV Information #pvdisplay Now we create Volume group #vgcreate Vg00 /dev/hda8 Display the Vg information #vgdisplay Finally we create a logical volume #lvcreate –n lv00 –L+50M vg00 Where -n : logical name -L: size Display the LV information #lvdisplay After creating the logical volume.

Red Hat Enterprise Linux 4. RAID1 and RAID 5 RAID 0 : require minimum 2 HDD and also known as stripping without parity RAID 1: require minimum 2 HDD and also known as disk mirroring 29 .0ES #lvreduce –L-20M /dev/vg00/lv00 If the size of the logical volume is full and we need more space to store data we need to create new partition . change its type to LVM by ‘8e’ then create the physical volume and add that with volume group (vg00) #vgextend vg00 /dev/hda9 After that extend the size of logical volume In order to delete the logical volume #umount /lvm #lvremove /dev/vg00/lv00 #vgremove vg00 #pvremove /dev/hda9 #pvremove /dev/hda8 Then finally using the fdisk remove hda8 and hda9 RAID Redundant Array Of Inexpensive Disk RAID is a series of disk which can save your data even if there is catastrophic failure on one of the disk RAID are classified as RAID0.

ext3 /dev/md0 Now mount it #mkdir /raid #mount /dev/md0 /raid In order to check first we fail any one of the partition #mdadm --manage /dev/md0 --fail /dev/hda8 Check the status of the RAID #mdadm --detail /dev/md0 Removing the failure partition #mdadm --manage /dev/md0 --remove /dev/hda8 To add new disk partition #mdadm --manage /dev/md0 --add /dev/hda10 Note: In order to add new partition first we create the partition and change its type to ‘fd’ Introduction to System Service Every computer that connect to network require some IP address assign permanently to a computer host known as static IP address and some IP subhki2000@gmail.0ES RAID 5: minimum 3 HDD requirement and also known as stripping with parity First we create the two partition say each of 100MB and then change its type to (‘fd’) Raid Now we create a RAID #mdadm –C /dev/md0 –level=1 –raid-disks=2 /dev/hda8 /dev/hda9 Now check the raid #cat /proc/mdstat ‘OR’ #mdadm --detail /dev/md0 Format the newly created RAID 30 .Red Hat Enterprise Linux 4.

24.0.0 Gateway = 172.254.10 Introduction To System Service According to the service management.0ES address leased by DHCP server for a limited period of time known as dynamic IP address. IPv6 IPv4 has a 32 bit and are in Octet-doted decimal lists Example: Netmask = 255. service which are managed by service command 3.Red Hat Enterprise Linux 4.254 IPv6 address have 120 bits To check the connectivity #ping 172.254 To check the IP address #ifconfig To set the IP address #netconfig Or #vi /etc/sysconfig/network Or #vi /etc/sysconfig/network-scriptd/ifcfg-eth0 Device = eth0 Boot Proto = static Onboot = yes IPaddr = 172. IPv4 2.24. service are divided into three category 1. It will remain until we restart the computer then after that it will take IP address from ifcfg-eth0 #ifconfig eth0 31 .0.24.255. service which are based on xinetd that is some back ground process services to check the service whether ON or OFF use #service service_name status #chkconfig –list #chkconfig –list service_name Example: #service nfs status #chkconfig –list #chkconfig –list nfs subhki2000@gmail.254 To make Network UP and DOWN #ifdown eth0 #ifup eth0 We can also assign temporary IP address to a LAN card.254.24. service which are managed by init command. which are not TCP/IP services 2. There are 2 standard IP address 1.

0ES To Make service ON or OFF #chkconfig nfs on #chkconfig nfs off To stop the particular service for particular Run level #chkconfig –level 3 nfs off #chkconfig –level 3 5 on/off To make on or off in run level 3 and 5 #ntsysv : will start /stop all the services in a particular run 32 .Red Hat Enterprise Linux 4. It will display the dialog box in which all the services are mentioned DHCP Dynamic Host Configuration Protocol DHCP provides IP address to host computer dynamically by the range of addresses or statically or fixed address by MAC address Service Profile Type : Package : Daemon : Script System V managed Service dhcp dhcpd : dhcpd subhki2000@gmail.

24.0. where x : Station number subhki2000@gmail.255.254.conf Now open file #vi /etc/dhcpd.sample /etc/dhcpd.0.0.24. Option subnet-mask : Option nis-domain : “RHCE” 33 .0ES File Port : : /etc/dhcpd. Range dynamic-bootp”.0.1 Netmask : 255. Option router : 172.1/dhcpd.24.conf Set the following configuration Subnet : 172.conf Set the following configuration host stationX { hardware Ethernet 00:34:e3:5r:q1:34. fixd-address 172.conf.68 First check the rpm #rpm –q dhcp Copy and rename dhcpd.10 Save and exit Start the service #service dhcpd restart #service portmap retstart #chkconfig dhcpd on #chkconfig portmap on Client Side #dhclient Dhclient is used to give the request to dhcp server to assign an address to client Now if we want to assign the static IP address by their MAC address #vi /etv/dhcpd. Option domain-name-server : 172.0. Option domain-name : “example.sample to dhcpd.0.254.0.Red Hat Enterprise Linux 4.conf in /etc #cp /usr/share/doc/dhcp-3.conf 67.conf.

rpc.statd.Red Hat Enterprise Linux 4.0ES NFS Network File System NFS server is used for file sharing and directory sharing between linux to linux machine Service Profile Type : Package : Daemon : Script Port : Configuration File Check the rpm # rpm –q nfs-utils System V-managed nfs-utils rpc.rquotad.nfsd : nfs 2048 : /etc/exports 34 .

0(rw.0.254.sync) If we give a space between the network and (rw.254 #showmount –e server1 Client Mount the /share directory on client machine #mount –t nfs:172.0/ Hat Enterprise Linux 4.sync) For all world #vi /etc/exports /share *(rw. Server Setting First make the folder which you want to share #mkdir /share #cd /share #touch a d f #chmod o+w a b Now open the configuration file #vi /etc/exports Make the following entry /share /share 172. To check #showmount –e 172.24.sync) /share then it will mount for everyone subhki2000@gmail.254:/share /mnt Where /mnt is a mount point For sharing particular IP address Server: #vi /etc/exports /share 35 .0(rw.255.sync) For two different network #vi /etc/exports /share 172.3/ Save and exit /share will be shared by the entire network Start the service #service portmap restart #chkconfig portmap on #service nfs restart #chkconfig nfs on Note: We need to restart the service portmap before nfs service in order to assign port number.

255.24. Service Profile Type Package : : system V manage Server Portmap ypserv make Client Authconfig authconfig-gtk portmap yprpc.sync) If we give no permission then it will take (ro.0.ypserv rpc.0 (rw.yppasswddd : ypserv. NIS Network Information Service NIS provide simple directory service for system and account information. yppasswdd : /etc/sysconfig/network /var/yp/Makefile tools ypbind Daemon Script Configuration Server Setting: : subhki2000@gmail. NIS server is used to manage the system and account information on multiple system from the central server.sync) #export –r #export –a #export –ar If we run this command then there is no need to restart portmap and nfs again and 36 .0/255.Red Hat Enterprise Linux 4.0ES #vi /etc/exports /share 172.

0ES Steps 1. Edit the file #vi /var/yp/Makefile Search for “/all: “ line Remove all the entry except all: passwd group hosts netid save and exit 4.0/255.0(rw. Now create a user with home directory /rhome/nisuserX #mkdir /rhome #adduser –d /rhome/nisuser1 nisuser1 #passwd nisuser1 7. start the service #service portmap restart #chkconfig portmap on #service nfs restart #chkconfig nfs on #service yppasswdd restart #chkconfig yppasswdd on 172.255.24. Now create a database for NIS server # /usr/lib/yp/ypinit –m -m : Master 6. Make the entry of the home directory of user in /etc/exports file #vi /etc/exports /rhome/nisuser1 Save and exit 8.0. Edit the file #vi /etc/sysconfig/network Define the following line NISDOMAIN=ICON Save and exit 3. Start the service #service portmap restart #chkconfig portmap on #service ypserv restart #chkconfig ypserv on 5.Red Hat Enterprise Linux 4.sync) 37 .0. Check the rpm’s #rpm –q portmap ypserv make 2.

Run the command #authconfig Or #system-config-authentication In this enable and write the following option “Enable NIS option” and Press F12 In NIS Setting Domain : ICON Server : 172. Check the rpm’s #rpm –q portmap authconfig authconfig-gtk yp-tools ypbind 2.254.intr 172. Finally login with user as “nisuser1” and passwd subhki2000@gmail.254:/rhome/nisuser1 Save and exit 4.24.soft.24. Start the service #service autofs restart #chkconfig autofs on 5.misc --timeout=60 This file define the path of the home directory #vi /etc/auto.254.misc” #vi /etc/auto.0ES 9.254 38 .Red Hat Enterprise Linux 4. Finally Update the database #cd /var/yp #make Client Setting: 1.misc Nisuser1 -rw.master” and “auto.master /rhome /etc/auto. Edit Two File “auto. Run the following command to check the password #ypcat passwd #getent passwd ypcat will display the entry of server user information getent will display the entry of local and server user information 6.

zone”.conf #vi /var/named/chroot/etc/named. Edit the file named.} .0ES DNS Domain Name Server DNS translate IP address to hostname or vise versa Service Profile Type : System V manage Package : bind. bindutils Daemon : named Script : named Configuration file : /var/named/chroot/etc/named. subhki2000@gmail. File “example. Zone “24. Allow-update {”IN{ Type master. caching-nameserver. 53 (TCP) Server Setting 1.172. bind-chroot.conf Edit the line after copying line N 37 to line 47 Zone “example. }.conf /var/named/chroot/var/named/* Port : 52 (UDP).com”{ Type master.Red Hat Enterprise Linux 39 .

com ( ………… ………… ………… ….24. Now Enter inside the following directory #cd /var/named/chroot/var/named Make two file by copying #cp localhost. ………. Allow-update {none.) @ IN NS server1. 4.0 IN PTR file #vi example. root.24. 1. Edit example.local 3. Edit the file example. #cp named.example.4 www IN CNAME server1 www1 IN CNAME station1 www2 IN CNAME station2 www3 IN CNAME station3 www4 IN CNAME station4 save and exit 5.254 IN PTR $TTL 86400 @ IN SOA server1.local” IN PTR station3.Red Hat Enterprise Linux 4. ( ……….0. Start the service subhki2000@gmail. ……) @ IN NS server1.24.local 2. Note: Like this we can make entry all the stations connected to that network Save and exit 4.0.}.com. 2. example. }.0ES File “example.2 Station3 IN A Server1 IN A 172.example. ……….254 Station1 IN A $TTL 86400 @ IN SOA server1.0 IN PTR station1.3 Station4 IN A 172.24.1 Station2 IN A 40 .

254 Search example.example.example.0ES #service named restart #chkconfig named on Savce and exit Now finally use the Dig and nslookup command to check the DNS from client side Term IN : Internet SOA : Start Of Authority TTL : Time to Line NS : Name server A : Address Record PTR : Pointer Record MX : Mail server SOA is the first line in the zone file.254.Red Hat Enterprise Linux #nslookup server1.24.24. Check the file /etc/hosts file DNS Client Open the file and check the setting #vi /etc/resolv. It identifies the name server as the authoritative source for information about this domain TTL indicate how long to hold the data in their cache NS shows the name of name server A shows the IP address for name server MX is a mail Exchange record PTR is used to point to the name server CNAME is CONONICAL name shows the real name of the host #nslookup 172.254 7. Dig the server #dig server1.conf Nameserver 41 .254.

com 42 . 3128 subhki2000@gmail.conf #vi /etc/squid/squid.conf Line number 54 http-port 8080 Line number 481 cache-mem 100MB Line number 1805 (syntax : acl acl_name acl_type network or domain) acl icon src 172.0 Line number 1865 http-access allow icon In order to deny we write http-access deny aclname Like : : : : System V manage Squid Squid : Squid : /etc/squid/squid. Check the rpm’s #rpm –q squid 2.0/255. Edit the file squid.0.255.24.Red Hat Enterprise Linux 4.0.conf 8080 .0ES Squid Proxy Server Proxy server is used for Internet Sharing Server Profile Type Package Daemon Script Configuration Port No Steps 1.

hotmail.0ES http-access deny icon If we want to restrict any site Syntax : acl aclname acltype Name or domain Example: acl icon1 dstdomain .254 Port 8080 Start the service #service squid restart #chkkconfig squid on Client Side: 1. Click editPreferences 43 .24.254. Select “ Manual Proxy Configuration” Http Proxy : 172. Click on Mozilla Web Browser 2.Red Hat Enterprise Linux 4. Click on “Connection Setting” 4.

example.24 OK 172.example. we need to run the ‘newaliases command to update the file #newaliases 44 .0. mutt .cf /etc/mail/access /etc/aliases Steps: 1. Now create a new #m4 /etc/mail/sendmail.0ES Send Mail Sendmail is used to configure the mail server on the server in order to send and receive the file through /etc/mail/ > /etc/mail/ Line number 105 DAEMON-OPTION(………………………. Service Profile Type : Package : Daemon : Port : Configuration File System V manage sendmail.) Disable this line by adding dnl# DISCARD OK : Allow REJECT : restrict and message reply will come DISCARD : restrict and message reply will not come 4. procmail. In order to allow / restrict other network or client or any user to send mail we edit file /etc/mail/access #vi /etc/mail/access After editing this file. m4 sendmail 25 : /etc/mail/sendmail.4 REJECT root@station6. sendmail-cf.24. Start the Service subhki2000@gmail.Red Hat Enterprise Linux 4.root@station6. In order to redirect the mail of any user to another we edit #vi /etc/aliases Root : raj. Edit the file 3.

Red Hat Enterprise Linux 4. To check status with job number #lpstat subhki2000@gmail. To Print any file #lp <filename> #lpr <filename> 4. To check the mail #mutt If any problem come that /var/spool/mail/root does not exits then create a file by #touch /var/spool/mail/root CUPS Common Unix Printer System UPS is the primary printing system under Re Hat Enterprise Path for the Queue Directory : /printer/xyz And finish the Wizard 2. based on HTTP/1. CUPS support a new Internet Printing Protocol (IPP).1 Configuration Steps: 1. Check the status of the Queue #lpq 3.example.0ES #service sendmail restart #chkconfig sendmail on 6. Type the following command #printconfig Or #system-config-printer Assign Queue name : xyz Device name : IPP Select Printer Driver “ raw printer queue” Server : server1. To remove any job #lprm job_number Or #cancel job_number 45 .

conf Add following line Userlist-deny = No In order to assign upload permission to ftp and anonymous users subhki2000@gmail. client machine connect to Target machine by having username and password on Target machine For anonymous user FTP working directory is ‘/’ / = /var/ftp We can also provide user level security We have two files #vi /etc/vsftpd. Anonymous Access 46 .conf #vi /etc/vsftpd/vsftpd.conf 21 : : FTP service provide two level of access a. User Access A In Anonymous access client machine can connect to target machine via users FTP and anonymous. linux to Unix and Linux to Windows Service Profile Type : Package : Daemon : Script Configuration File Port : System V manage vsftpd vsftpd vsftpd /etc/vsftpd/vsftpd. By default these users have only permission to download (get) B In user access.0ES FTP: File Transfer Protocol FTP provides file sharing between linux to linux . In this case we don’t require password.ftpuser #vi /etc/vsftpd.Red Hat Enterprise Linux 4.user_list can only access ftp server then we need a entry in vsftpd.user_list User entry in these two file are not allowed to access ‘ftp’ If we want that user entry in vsftpd.

Red Hat Enterprise Linux 4.254.conf Anonymous-enable = yes #uncomment line 27 Anon-upload-enable = yes #uncomment Chown-uploads = yes Chown-username = daemon Now create a directory inside /var/ftp #mkdir upload #chmod 777 upload Chgrp ftp upload Assign group owner ship to ftp to ‘upload’ directory Start the Service #service vsftpd restart Access FTP #ftp For Anonymous user Username = ftp Password =`press Enter` For User Access Username = rakesh Password = ***** In Graphical ftp://rakesh@172.254 47 .24.0ES #vi /etc/vsftpd/vsftpd.24.254 To upload: put To download : get Example: #put <filename> to upload any file in user home directory #get <filename. To download any file from user home directory We can also open ftp server as #elinks ftp://172. Restriction For User to Access Web site #vi /etc/httpd/conf/ DocumentRoot /www ServerName #elinks http://server1.0ES APACHE WEB SERVER Apache Web Server is used for Web Hosting.24.254:80> ServerAdmin root@server1.conf <VirtualHost 172. portmap /etc/httpd/conf/ 48 . Service Profile Type Daemon Script Port Package : : : : : System V Manage httpd httpd 80 httpd.example. Check the rpm #rpm –q httpd 2.html Now start the service #service httpd restart #service portmap restart #chkconfig httpd on #chkconfig portmap on Now dig the site #dig </VirtualHost> Save and exit Now create a directory #mkdir /www #cd /www #vi index.conf Configuration File : Steps: 1.254.254:80 Now copy line No 1016 to No.254:80> ServerAdmin subhki2000@gmail. For multiple Hosting we need to uncomment line number 1003 NameVirtualHost 172.Red Hat Enterprise Linux 4. 1022 and paste at last <VirtualHost 172.24. With the help of Apache we can host multiple Website.example.example.

Red Hat Enterprise Linux 49 .0ES DocumentRoot /www ServerName Server1. The mail difference between SSH and telnet is that SSH can be used for file transfer.access raj #chgrp apache /etc/httpd/ <Directory /www> Option Indexes Includes AllowOverride Authconfig </Directory> </VirtualHost> Now create one file .htaccess AuthName “allow users” AuthType Basic AuthUserFile /etc/httpd/ht.htaccess in /www #vi /www/.example. subhki2000@gmail.access Start the Service #service httpd restart #chkconfig httpd on #elinks http://server1.access Require valid-user Save and Exit Now create one user #adduser raj #htpasswd –c /etc/httpd/ Open SSH Server SSH or Secure Shell is used for the purpose of remote login between linux to linux and linux to Unix.example.

cfg 172.24.24. open 50 .254.254.Red Hat Enterprise Linux 4.log /mnt If you want to directory #scp –r 172.254:/root/raj /mnt If you want to copy file from client machine to ssh server #scp /root/anaconda-ks.254.24.254. linux to Unix and Linux to windows Service Profile Type : System V Manage subhki2000@gmail.254:/root/install.24.254 (By root) If you want to display any welcome Note at the time of connecting #Banner Banner /etc/banner If you want to copy file from ssh server to client #scp 172.254 ( by User) #ssh 172.254:/root Remote shut down #ssh 172.0.1 Save and exit Start the service #service sshd restart #chkconfig sshd on #ssh raj@172.24.0ES Service Profile Type : Package : client Daemon : Port : Script Configuration File System V manage open ssh. opensshsshd 22 : : sshd /etc/ssh/sshd-config If you want root should not login then #vi /etc/ssh/sshd-config Line PermitRootLogin No Uncomment line number 13 and 14 Port 22 Protocol init 6 Or Slogin command can also be used Samba Samba can be used to share file and printer between linux to linux.

24. nmbd smb 51 .conf Workgroup = CORP Server String = Samba Host allow = 172.254 Mounting share folder #smbmount //172. samba-common. If forwarding is not enabled.0 Then copy last 8 line [raj] Path = /data Valid users = raj rakesh Public = no Writeable = yes Browse able = yes Save and exit Now create a Users #adduser raj #adduser rakesh #smbpasswd –a raj #smbpasswd –a rakesh Start the service #service smb restart #chkconfig smb on On client side #smbclient //172.168.24. To check type #cat /proc/sys/net/ipv4/ip-forward If forwarding is enabled.254.conf #vi /etc/samba/smb. we can’t use a computer with two network interface to route between two or more subnet.conf Edit the file smb.254/raj –U raj GUI Smb://172. subhki2000@gmail.254.0.254/data /mnt –o username=rakesh IP Forwarding In Linux. samba-client smbd. the number 0 is returned.0ES Package : Daemon : Script : Port : Configuration file : /etc/samba/smbpasswd Samba.169 /etc/samba/smb.24. We should make sure that module is loaded.24.254.254/255.255. the number 1 is returned. To be able to do this we need to make sure that we enable IP forwarding.Red Hat Enterprise Linux 4.254.

254.24.deny By default all are allowed subhki2000@gmail.0 172.Red Hat Enterprise Linux 4. security provided by xinetd TCP Wrappers Configuration needed two file a.25.254.254. Hosts.7 Net.254 (-d : virtual) 172.0.ipv4.0ES To enable IP forwarding #vi /etc/sysctl.ip_forward = 1 Save and exit To activate permanently #sysctl –p Or another method is #echo 1 >/proc/sys/net/ip_forward This work for temporary use till system is ‘ON’ Now for the first network #netconfig IP address : Subnet Default Gateway : Primary server Second network #netconfig –d eth0:1 IP Address Subnet Default Gateway Primary Server 172. there are three type of security policies 1.254 : : : Security Policies According to the service management.25. Security within a service 2.254 : 172.254.254 : 52 . security provided by TCP wrappers 172. Hosts.24.255.allow b.254 : 255.0 172.conf Line no.254. to use ssh service and disallowing all other network #vi /etc/ 53 . and deny outside network ( EXCEPT 172.0.0.deny Sshd : ALL EXCEPT #vi /etc/hosts.redhat.0 Example 4: Network example.24.24.0 except 172.deny Vsftpd: ALL EXCEPT 172.allow In.0.0/255.1 172.0/255.25.deny #vi /etc/hosts.255.telnetd : . nmbd subhki2000@gmail.telnetd : station1.0.0 Similarly we can make entry for SSH.0.0/ Example 5: Allowing 172.allow Sshd : 172.example. Hat Enterprise Linux .0.0.0 In order to deny other network Vsftpd: ALL Deny other network except 172.deny Vsftpd: 172.2 allowed to use SSH service #vi /etc/hosts.0.0 Example 2 : allowing 172.255.24.allow Vsftpd: 172.0/ Or we can assign station wise In.0.0 In this case just make entry in Some of the daemon are Imapd Ipop3d Smbd. redhat.255. IMAP.0ES Check the rpm #rpm –q tcp_wrappers Syntax Daemon_list : client_list Example 1: Network 172.0 #vi /etc/hosts. and POP3 Example 3: Network Vsftpd: 172.0/55.2 172.24.0 are not allowed to use ftp service #vi /etc/hosts.24. allowed to use telnet service #vi /etc/hosts.

6 Save and exit By default all node in a network can access through telnet For particular system #vi /etc/xinetd.d/telnet Only_from = 172.0ES Telnet Telnet service is used for the purpose of remote login between linux to linux. telnet based on xinetd based on xinetd : /etc/xinetd.6 Time setting #vi /etc/xinetd/telnet Acees_time = 04:15=04:30 If we want to login with username as root and by default we cannot #vi /etc/securetty Add two line Pts/0 Pls/1 subhki2000@gmail. For range of node #vi /etc/xinetd/telnet Only_from = 172.4} 3.Red Hat Enterprise Linux 54 . Deny particular node #vi /etc/xinetd/telnet No_access = 172.0.d/telnet Make Disable = no Save and exit Start the service #service xinetd restart #chkconfig xinetd on Security setting 1.0.d/telnet Check the rpm #rpm –q telnet-server telnet Edit the file #vi /etc/xinetd.24. linux to unix and linux to windows Service Profile Type Package Daemon Script Configuration : : : : xinetd telnet-server.24.3.{1.

0.0.0/ 55 .24.24.0 #vi /etc/hosts.0.0 Imapd : 172. 14 Protocols = imap imaps pop3 pop3s Save and exit Start the service #service dovecot restart #chkconfig dovecot on #chkconfig xinetd on Now in order to provide security Allowing local network to access the pop3 and imap and disallowing other #vi /etc/hosts.allow Ipop3d : 172.255.deny Ipop3d : ALL subhki2000@gmail.Red Hat Enterprise Linux 4.0ES Configuration of POP3 and IMAP IMAP is used for the authentication and POP3 is used for mailing We need to configure #vi /etc/dovecot.conf Uncomment line No.0.0/255.255.

email address after making all those entry we need to copy this file #cp dovecot.pem Low Level Format The command ‘shred’ is used for low level format 25 times.pem /usr/share/ssl/private/ 56 . in this case Umask means 666-002 = 664 for normal user and for the root the default value will be 666-022=644 subhki2000@gmail.0.0.pem #make dovecot.Red Hat Enterprise Linux 4.25. we can’t recover files after this #shred /dev/hda UMask User Mask Default value for root = 0022 Default value for users = 0002 When we create any new file.255.0 To check the status #nmap stationx Or #namp localhost Digital Certification Certificate is used for the purpose of authentication Steps 1.0 Ipop3d : 172. country b. station name f. state c.pem file in #cd /usr/share/ssl/certs #rm dovecot.255.pem Overwrite : yes To check the status or entry #openssl x509 –noout-subject </usr/share/ssl/private/dovecot.0.pem In this we have to make the following entries a.25. company and unit name e.0/255.0ES Imapd : ALL These permission are set when host from local network can access pop3 and imap and hosts from other network does’nt allow In order to disallow outside network say 172. Check for devecot.0.0.0/255. street d. The default value will be 666.0 Imapd : 172.25.

conf #vi /etc/grub.0) Kernel /vmlinuz-2.6. the default valkue for normal user 777002 = 775 and for 57 .9-5. in this case umask means that whenever we create new directory.conf file found in /boot/grub/grub.9-5.6.img 2. INITTAB FILE Run level setting are done in inittab file. GRUB.xpm. the default value 777-022 = 755 Some Important File Settings: 1. It is the default boot loader used by Red Hat Linux Grub.conf Default = 0 Timeout = 5 Splash image=(hd0.gz Hidden menu Title Redhat Linux Root (hd0.Red Hat Enterprise Linux 4.CONF GRUB stands for GRand Unified Bootloader.conf and its symbolic links found in /etc/grub.0ES The default value for a directory is 777.0)/grub/splash.EL ro root=LABEL=/ rhgb quiet Initrd /initrd-2.EL. Inittab found in /etc/inittab #vi /etc/inittab subhki2000@gmail.

d/rc 6 ca::ctrlaltdel:/sbin/shutdown –t3 –r now * 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 X:5:respawn:/etc/x11/prefdm –nodaemon Setting Grub Password Two method are used to set grub password Method I: #vi /etc/grub.d/rc 0 l1:1:wait:/etc/rc.Red Hat Enterprise Linux 4.d/rc 2 l3:3:wait:/etc/rc.conf Enter two times the password In this case the password will be encrypted and directed (>>) to file grub.d/rc 4 l5:5:wait:/etc/rc.conf Below Hiddenmenu Password = redhat This password is not in encrypted 58 .sysinit l0:0:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc. Method II: Encrypted form #grub-md5-crypt >>/etc/grub.conf Copy that password line from the bottom most and paste it bellow hidden menu option as Password –md5 <password> Save and exit subhki2000@gmail.d/rc 5 l6:6:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.conf Now open file #vi /etc/grub.d/rc.0ES id:5:initdefault: si::sysinit:/etc/rc.

Sign up to vote on this title
UsefulNot useful