0% found this document useful (0 votes)
37 views197 pages

LINUX - Lab Manual - Text

Uploaded by

yusufsheik.27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views197 pages

LINUX - Lab Manual - Text

Uploaded by

yusufsheik.27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 197

ZOOM

TECHNOLOGIES

Lab Manual
0
LINUX
System Administration

RHCE Mapped Course

Lab Manual

0
© 2015 Zoom Technologies India Pvt. Ltd.

All rights reserved. No part of this book or related material may be reproduced in any
form or by any means without prior permission from Zoom Technologies India Pvt.
Ltd. All precautions have been take to make this book and related material error-free.
However, Zoom Technologies India Pvt. Ltd. is not liable for any errors or omissions.
The contents of this book are subject to change without notice.
DISCLAIMER: RHCE is the registered trademark of RED HAT Inc.

0
Introduction

This lab manual has been designed as a supplement to the Linux Server
Administration course offered by Zoom Technologies.

We have taken care to ensure that this serves as a comprehensive reference


manual for the Linux administrator. The exercises have been arranged in order of
increasing complexity, starting from the installation of the Linux OS right up to web
server administration and covering everything else in between.

It has been written in a simple and easy style, with plenty of screenshots wherever
required and the syntax clearly given before each command. As with our other lab
manuals, we have used the same structure for these exercises, with each exercise
divided into five sections:

1. Objective
2. Topology
3. Prerequisites
4. Configuration
5. Verification / Result

We hope that this will serve as a useful guide to the Linux professional, not only
during the course but in actual implementation at the workplace. We have tried to
ensure that no errors or mistakes creep in, but suggestions and feedback to improve
this manual are always welcome.

0
ZOOM
TECH NOLOGIES

Table of Contents

LAB 1: INSTALLATION OF LINUX OPERATING SYSTEM 1

LAB 2: BASIC COMMANDS -I 14

LAB 3: BASIC COMMANDS II 23

LAB 4: VISUAL INTERFACE (VI EDITOR) 28

LAB 5: USER ADMINISTRATION 31

LAB 6: GROUP ADMINISTRATION 42

LAB 7: PERMISSIONS 47

LAB 8: ACCESS CONTROL LIST 51

LAB 9: CHANGE OWNERSHIP OF FILES AND DIRECTORIES 55

LAB 10 : CHANGE GROUP OWNER OF FILES AND DIRECTORIES 57

LAB 11: PARTITIONS 60

LAB 12: SWAP PARTITION (VIRTUAL MEMORY) 66

LAB 13: DISK LABEL 70

LAB 14 : DISK QUOTAS 73

LAB 15: LOGICAL VOLUME MANAGER (LVM) 81

LAB 16 : REDUNDANT ARRAY OF INDEPENDENT DISKS (RAID) 94

LAB 17: BACKUP AND RESTORE USING TAR AND FILTER THE ARCHIVE THROUGH GZIP(-z) 104

LAB 18: BACKUP AND RESTORE USING TAR AND FILTER THE ARCHIVE THROUGH BZIP2(-j) 107

LAB 19: BACKUP AND RESTORE USING CPIO COMMAND 110

LAB 20: NETWORK CONFIGURATION- IP ADDRESSING 113

LAB 21: PACKAGE MANAGEMENT (RPM COMMAND) 121

To install packages from dvd 122

To install packages from server by using "NFS' service 124

To query the packages with some more options of rpm 125

LAB 22: PACKAGE MANAGEMENT (YUM COMMAND) 128

LAB 23: DHCP SERVER 131

DHCP Client Configuration 134

LAB 24: FTP SERVER 136

FTP Server Configuration for downloading files 137

FTP Client Configuration for downloading files 138

www.zoomgroup.com

0
ZOOM
\JECH NOLOGIES/

FTP Server Configuration for uploading files 139

FTP Client Configuration for uploading files 140

LAB 25: YUM SERVER 141

YUM Server Configuration 142

YUM Client Configuration 144

LAB 26: NFS SERVER 145

NFS Server Configuration 146

NFS Client Configuration 147

LAB 27: DNS SERVER 149

DNS Server Configuration 150

DNS Client Configuration 155

LAB 28: POSTFIX MAIL SERVER 158

Mail Server Configuration 159

Configuration of Squirrel Mail to compose the mail on GUI mode 162

Mail Server Client Configuration 164

LAB 29: APACHE WEB SERVER 167

Apache Server Configuration to host websites based on names 168

Web Server Client Configuration 170

Apache Server Configuration to host websites based on IP addresses 172

Web Server Client Configuration 173

Port based websites configuration 174

Web Server Client Configuration 174

LAB 30: AUTHENTICATION ON APACHE WEB SERVER 176

Web Server Authentication 177

Web Client Authentication 178

LAB 31: WEBMIN ADMINISTRATION 180

GUI Based application to manage network via browser 181

www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 1: INSTALLATION OF LINUX OPERATING SYSTEM

OBJECTIVE:

To install Linux Operating System.

PRE-REQUISITE:

A user should have a system along with OS DVD.

TOPOLOGY:

LINUX Lab Manual Page | 1 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Steps to Install Linux

1. Restart the System and go to BIOS.

2. Set the First Boot Device as DVD ROM.

PhiHiilKBIDS Setim Utility

3. Save the settings by Pressing F10 and click YES.

4. Insert LINUX DVD and Restart the system.

5. Select Install CentOS 7 option to install new Operating System

CentOS 7

Install CentOS 7
Test this media & install CentOS 7

Troubleshooting >

Press Tab for full configuration options on menu items.

LINUX Lab Manual Page | 2 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

6. Select skip to avoid media test

lelcome to CentOS Tor x86_6d

1 Disc Found |

To beyin testing the media before


installation press OK.

Choose Skip to skip the media test


and start the installation.

|g|
<Tab>/<ftIt-Tab> between elements I <Space> selects I <F1Z> next screen

Press ENTER to proceed with installation

- Press the key to begin the installation process.

LINUX Lab Manual Page | 3 www.zoomgroup.com

0
8 . Verify installation language e.g.: English and click next

CENTOS 7 INSTALLATION

ESS us

WELCOME TO CENTOS 7.

What language would you like to use during the installation process?

English English >T English (United States)


M
English (United Kingdom)
Afrikaans Afrikaans
English (India)
Amharic
English (Australia)
Arabic
English (Canada)
Assamese
English (Denmark)
Astunanu Asturian
English (Ireland)
EenapycKan Belarusian English (New Zealand)
Eb/irapt KH Bulgarian English (Nigeria)
Tt?oTt Bengali English (Hong Kong SAR China)

Type here to search o

Quit Continue

9. Make sure it is the right installation language e.g. English and click next

What language would you like to use during the


P3 installation process?

Arabic
Assamese («P^XT)

Bengali <«3T**n)
Bengaii(lndia) (*nF5)>
Bulgarian (6t>nrapcK»)
Catalan <Catalk)
Chinese{Simplihed) (*+*?? ( )
ChineseTTVaditional) (£05) )
Croatian (Hrvatski)
Czech (CeStirva)
Danish (Dansk)
Dutch (Nederland* I
English (English)
Estonian leesti keel)
Finnish (suomi)
French (Ftarx;ais)
German (Dent sc h)
Greek (EAArivruH)
Gujarati (^irtirfl)
Hebrew (nnzy)
Hindi (T9^t)
Hungarian (Magyar)
Icelandic (Icelandic)
lloko (lloko)
Indonesian (Indonesia)
J*m 11 ■ ■ *■*-»* » JU

flack [

LINUX Lab Manual Page | 4 www.zoomgroup.com


ZOOM
TECH NOLOGIE!

10. Window of installation summary

INSTALLATION SUMMARY CENTOS 7 INSTALLATION

CentOS LOCALIZATION

DATE & TIME KEYBOARD


Americas/New York time zone English (US)

LANGUAGE SUPPORT
English (United States)

SOFTWARE

INSTALLATION SOURCE SOFTWARE SELECTION


Local media Minimal Install

SYSTEM

INSTALLATION DESTINATION NETWORK & HOSTNAME

Quit

I'Ve tv<OT*t touch your dukt until you click 'Beg//? !nitsll*tion'>

^ Plea*, e omplete item* marked with tht* icon before continuing to the next step

11. Select time zone e.g. Asia Kolkata and click next

AAA
1 O 24-hour
2:01 AM/PM
October V 7 v 2014 Nr

V V V

You need to set up networking first if you Want to use NTP

LINUX Lab Manual Page | 5 www.zoomgroup.com


ZOOM
TECH NOLOGIE!

12. Provide installation source and click next

INSTALLATION SOURCE CENTOS 7 INSTALLATION

Which installation source would you like to use?

O Auto-detected installation media:

Device: srO
C V
Label CentOS_7_>86_64 "

On the network.

Additional repositories

Enabled Name Nome:

http // v

O This URL refers to a mirror litt.

Proxy URL:

Uvrnnme:
£
+

Password!

13. Select Hard disk—>"l will configure partitioning" and click next

INSTALLATION DESTINATION CENTOS 7 INSTALLATION

Device Selection

Select the device(s) you'd like to install to. They will be left untouched until you click on the mair
“BeginInstallation* button.
Local Standard Disks

34.81GB

VMware, VMware Virtual S

sda / 34 81GB free

Dtsks left un%elected here will not be touched

SpvcUlk.d 8c Network Dltkw

Add J disk...

Disk3 left unselected here *vtlf not he touched

Other Storage Options

Partitioning

Automatically configure partitioning. O l will configure partitioning.

Full disk summary and hootloadf 1 disk selected, 34. 81 GB capacity; 34 81 GBfr

LINUX Lab Manual Page | 6 www.zoomgroup.com


ZOOM
\JECH N OLOG IES

14. Provide size, mount point and click next

MANUAL PARTITIONING CENTOS

New CentOS 7 Installation


You hrvcn't created nny mount points tor your
CentOS 7 installation yet You can:

:k here tc Titc trerr mifomrfinll/

• Create new rnounx points by click


button.
ADD A NEW MOUNT POINT

New rrount points will ucc the fot^ N*or e cuslomnaliun op t <_>i is die available
artitioning schem
after creating the mount point below.

LVM JI CentOS 7 in si
Mount Point: /boot

Desired Capncity

Cancel Add mount point

Note: Follow the same procedure for all the other partitions required.

15. After creating all partitions, the result is:

MANUAL PARTITIONING CENTOS 7 INSTALLATION

New CentOS 7 Installation sda7

DATA
/home 2 GB Name: | cda7
*da6
Mount Point:
SYSTEM
/boot 500 MB Label:
sdal
Desired Capacity: 1 GB
/var lO GB
sdaS
Device Type: Standai d Partition Encrypt
/ lO GB
sda2 Fit*? System! iwap

/uxr lO GB
sda3

swap | Update Scttmgc


1GB
s da 7
Note. The zettingt you nuke on thin screen will not be epplied
until you click on the nuun menu*» '3*gm ln%tsllmtian‘ button.

+ - H c B

AVAIl ABLE SPACE TOrAI SPACE


1.31 GB 34.81 GB

1 %tc device selected Re*et All

LINUX Lab Manual Page | 7 www.zoomgroup.com


ZOOM
TECH NOLOGIE!

16. Click next to install bootloader

7 install boot loader on /dev/vda. | Change device

Use a boot loader password

Boot loader operating system list


Default Label Device
CentOS /dev/mapper/volGroup fv.root

17. Select GNOME Desktop and choose applications to install.

SOFTWARE SELECTION CENTOS 7 INSTALLATION


Done

Base Environment Add-Ons for Selected Environment


Basic Web Server
Server for serving static and dynamic internet
content. Legacy X Window System Compatibility
Compatibility piograms foi migration from or
Virtualization Host
working with legacy X Window System
Minimal virtualization host.
environments.
Server with GUI
Server for operating network infrastructure
Office Suite and Productivity
services, with a GUI.
A full-purpose office sute. and other productivity
& GNOME Desktop tools.
GNOME is a highly intuitive and user friendly
Remote Desktop Clients
desktop environment

KDE Plasma Workspaces


^ Smart Card Support
The KDE Plasma Workspaces, a highly-configurable
Support for using smart card authentication
graphical user interface which includes a panel,
desktop, system icons and desktop widgets, and
many powerful KDE applications. ^ Compatibility Libraries
Compatibility libraries for applications built on

Development and Creative Workstation


previous versions of CentOS Linux.

Workstation for software, hardware, graphics, or


content development. Development Tools
A basic development environment

LINUX Lab Manual Page | 8 www.zoomgroup.com


ZOOM
TECH N OLOG IE!

18. Configure Hostname

NETWORK & HOSTNAME CENTOS 7 INSTALLATION


Done* j t J .. |jf

No network devices available

Hostname: centos7.zoom.com

19. Provide an IP-Address

NETWORK & HOSTNAME CENTOS 7 INSTALLATION

Editing Team connection 1

Connection name; Team connection 1 table

3 on or ill Team IPv4 Settings

Method: Automatic (DHCP)

Automatic (DHCP) addresses only


Acldi esse
Add i J Manual
Link-Local Only

Shared to other computers

Additional DNS servers:

Additional search domains:

DHCP client ID

Require IPv4 addressing for this connection to complete

Routes...

Hostname: contos7. zoom


cancel

LINUX Lab Manual Page | 9 www.zoomgroup.com

0
20. Provide a root password and click forward

ROOT PASSWORD CENTOS 7 INSTALLATION


Done

The root account is used for administering the system. Enter a password for the root user.

Root Password:

Weak

Confirm:

You have provided a weak password: The password fails the dictionary check - it is based on a dictionary word. Press
Done again to use anyway.

21. Create a non-root user and click forward

Welcome
License
Information
Create User
* Create User 'ibu must create a username' for regular (non administrative) use of your
system To create a system 'username*. please provide the ^formation
Date and Time
requested below
Kdump
iisemame:

Ful Name:

password:

Confirm Password:

if you need to use network authentication such as Kerberos or NtS


please click the Use Network Login button

Use Network loom .

if you need more control when creating the user (specifying home
directory, and/or UlD). please click the Advanced button.

Advanced...

Back | forward I

LINUX Lab Manual Page | 10 www.zoomgroup.com


ZOOM
TECH N OLOG IE

22. The Installation process will take place

CONFIGURATION CENTOS 7 INSTALLATION

USER SETTINGS

ROOT PASSWORD USER CREATION


Root password Is set No user will he created

Complete!

CentOS i& now luctetfcfully instilled on your fcyitem and ready for you to use’ Go ahead end reboot to
start using it!

Reboot

i-jj Use of this product is subject to the license agreement found at /usr/share/centos-release/EULA

23. Select forward and finish

Kdump
Kcfcmp it a kernel crash dumping me hanitrr in the even! of a system
cr«l tdunrp ■«! capture nforrrationlrornycur system that car be
n.-a jat*« ir determrsng the cause o# the crash Note that kdurrp does
r
vat*"e reserwig a portion ot system memory that t>« unavailable for
other uses

i/ doable Mump 7

Kdtmp Memory beservalieh- • Automatic Manual

ntemory c uhenrly (fescrved (MB): 0

Advanced kdump eorhgjraron


9 . c- ’-j *•'>*! -I | i i i

* Th T *•* con-src a tenet of rommandeto perform Cmerderl when n *


* UT« crash tes happen a and the kdump kernel hat teen loaded L>re -
* mis He are only appkcabke to the kdurrp inersrn+s and have r»o effect t
* the root filesystem «s mourted and the normal mt scripts are processed
*
• Cur'enty only one dump tirget end petn may be corfpured at once
a r the r nhgjrad dur-cj 14rj>* fait the default «: ton *»H be preformed
$ the dskaUt actior may be configured Mth the dofaut direct rve below. If th
§ configured dump target succedes
$
9 BASKS commandi supported are:
$ raw <partitions a*il dd Jpioc/Vmcote <nto <pprUion>.
t usr pemstenr device names for partition devices.
9 such as /devfvgr< devrame>
#
m rfs <nf% mount > - JkI mount h trxi copy flycc/rmcore to
• <mnt>A‘arfcrash/s»»OST.saDAJE/. supports DNS

LINUX Lab Manual Page | 11 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

24. Select Not listed option


W»<I00 5« 0*0

zoom

Not ii.i«n

LINUX Lab Manual Page | 12 www.zoomgroup.com

0
Verification

• Provide username e.g. root


A n»ot *a

Cancel Unlock

Provide password e.g. zoom_123


Sat 10 54 0 ** O

P*ir«ora

Cancel 0 Sign In

LINUX Lab Manual Page | 13 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 2: BASIC COMMANDS -I

OBJECTIVE:

To operate the Linux Operating System using basic commands

PRE-REQUISITE:

Make sure you have a machine with Linux OS.

TOPOLOGY:

LINUX Lab Manual Page | 14 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To check the present working directory

Syntax:

[root localhost ~]# pwd

[root localhost ~]# pwd

Result:

/root

2. To see the list of files and directories(the current directory by default)

Syntax:

[root@localhost~]# Is <option>

[root@localhost ~]# Is

Result:

anaconda-ks.cfg Desktop Documents Downloads initial-setup-ks.cfg Music Pictures Public


Templates Videos

3. To see the long list (properties) of files and directories

[root@localhost ~]# Is -I

Result:

total 76

-rw . 1 root root 1805 Aug 18 06:31 anaconda-ks.cfg


-rw . 1 root root 8605696 Aug 30 22:56 core.5864
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Desktop
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Documents
drwxr-xr-x. 2 root root 4096 Aug 2114:29 Downloads
-rw-r-r--. 1 root root 1856 Aug 20 09:31 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Music
drwxr-xr-x. 2 root root 4096 Aug 2114:29 Pictures
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Public
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Templates
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Videos

#### OR ####

LINUX Lab Manual Page | 15 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# II

Result:

total 7624
-rw . 1 root root 1805 Aug 18 06:31 anaconda-ks.cfg
-rw . 1 root root 8605696 Aug 30 22:56 core.5864
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Desktop
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Documents
drwxr-xr-x. 2 root root 4096 Aug 2114:29 Downloads
-rw-r--r--. 1 root root 1856 Aug 20 09:31 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Music
drwxr-xr-x. 2 root root 4096 Aug 2114:29 Pictures
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Public
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Templates
drwxr-xr-x. 2 root root 4096 Aug 2114:16 Videos

4. To see the list of files/folders including hidden also.

[root@localhost ~]# Is -a

Result:

.bash_history .bashrc core.5864 Desktop .esd_auth .local Pictures .tcshrc


.bashjogout .cache .cshrc Documents .ICEauthority .mozilla Public
anaconda-ks.cfg .bash_profile .config .dbus Downloads initial-setup-ks.cfg Music Videos
Templates

5. To see a file starting from letter D*

[root@localhost ~]# Is D*

Result:

Desktop Downloads Documents

6. To see a file or folder whose length is of 6 characters, where ? is used to match any single
character

[root@localhost ~]# Is -d ??????

Result:

Public Videos

LINUX Lab Manual Page | 16 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

7. To create a text file by using cat command

Syntax:

[root@ local host ~]# cat > <filename>

[root@localhost ~]# cat > filel

hi how are you, how is your Linux sessions

ctrl+d (to save)

8. To see an existing file contents

Syntax:

[root@ local host ~]# cat <filename>

[root@localhost ~]# cat filel

Result

hi how are you, how is your Linux sessions

9. To append an existing file

Syntax:

[root@ local host ~]# cat » <filename>

[root@localhost ~]# cat » filel

They are good

Ctrl+d (to save)

Verification:

[root@localhost ~]# cat filel

hi how are you, how is your Linux sessions

They are good

0
ZOOM
TECH NOLOGIES

10. To create files by using touch command

Syntax:

[root@localhost ~]# touch <file_l> <file_2> <file_n>

[root@localhost ~]# touch CCIE CCNP CCNA "Advanced Linux"

Verification:

[root@localhost ~]# Is

Advanced Linux anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents initial-

setup-ks.cfg Templates Music Public Pictures Videos

11. Creating a single directory

Syntax:

[root@localhost ~]# mkdir <directory name>

[root@localhost ~]# mkdir zoomgroup

Verification:

[root@localhost ~]# Is

Advanced Linux anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents initial-

setup-ks.cfg Templates Music Public Pictures Videos zoomgroup

12. Creating multiple directories

Syntax:

[root@ local host ~]# mkdir <dir_l> <dir_2> ... <dir_n>

[root@localhost ~]# mkdir linux mcse "Ethical Hacking"

Verification:

[root@localhost ~]# Is

Advanced Linux anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents


Ethical Hacking initial-setup-ks.cfg linux Templates mcse Music Public Pictures Videos
zoomgroup

LINUX Lab Manual Page | 18 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

13. To create nested directory along with child directories

Syntax:

[root@ local host ~]# mkdir -p <dirl>/<dir2>/<dir3>/<dir4>/<dir5>/<dir6>

-p (parent directory)

[root@localhost ~]# mkdir -p linuxtech/clusters/san/ldap/nagios/samba

14. To see the tree structure

[root@localhost ~]# Is -R linuxtech

Result:

linuxtech:
clusters

linuxtech/clusters:
san

linuxtech/clusters/san:
Idap

linuxtech/clusters/san/ldap:
nagios

linuxtech/clusters/san/ldap/nagios:
samba

linuxtech/clusters/san/ldap/nagios/samba:

15. To change a directory (Navigation between Directories)

Syntax:

[root@ local host ~]# cd <dir_l>/<dir_2> /<dir_n>

[root@localhost ~]# cd linuxtech/ciusters/san/ldap/nagios/samba

Verification:

[root@localhost samba]# pwd


/root/linuxtech/clusters/san/ldap/nagios/samba

LINUX Lab Manual Page | 19 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

16. To move 1 step back

[root@localhost samba]# cd..

Verification:

[root@localhost nagios]# pwd

/root/linuxtech/clusters/san/ldap/nagios

17. To move 2 steps back

[root@localhost nagios]# cd../..

Verification:

[root@localhost san]# pwd

/root/linuxtech/clusters/san

18. To go directly to user home directory

[root@localhost san]# cd

Verification:

[root@localhost ~]# pwd

/root

19. To go to last working directory

[root@localhost ~]# cd -

Result:

/root/linuxtech/clusters/san

Verification:

[root@localhost san]# pwd

/root/linuxtech/clusters/san

0
ZOOM
.TECHNOLOGIES.

20. To remove files

Syntax:

[root@localhost ~]# rm <filename>

[root@localhost san]# cd

[root@localhost ~]# rm "Advanced Linux"

rm: remove regular empty file 'Advanced Linux1? y

Verification

[root@localhost ~]# Is

anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents


Ethical Hacking initial-setup-ks.cfg linuxtech linux Templates mcse Music Public Pictures
Videos zoomgroup

Note:

Deleted Advanced Linux file cannot be displayed.

21. To remove an empty directory

Syntax:

[root@localhost ~]# rmdir <directory name>

[root@localhost ~]# rmdir linux

Verification :

[root@localhost ~]# Is

anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents


Ethical Hacking initial-setup-ks.cfg linuxtech Templates mcse Music Public Pictures Videos
zoomgroup

Note:

Deleted linux directory cannot be displayed

LINUX Lab Manual Page | 21 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

22. To remove a directory along with all sub directories and files forcefully

Syntax:

[root@localhost ~]# rm -rf <dir_name>

[root@localhost~]# rm -rf linuxtech

Verification:

[root@localhost ~]# Is

anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents


Ethical Hacking initial-setup-ks.cfg Templates mcse Music Public Pictures Videos zoomgroup

Note:

Deleted linuxtech directory cannot be displayed

LINUX Lab Manual Page | 22 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 3: BASIC COMMANDS II

OBJECTIVE:

To operate the Linux Operating System using basic commands like copy, paste, move, etc.

PRE-REQUISITE:

Linux machine with VI editor

TOPOLOGY:

LINUX Lab Manual Page | 23 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To copy file data from one file to another

Syntax:

[root@localhost ~]# cp <source _file> <destination_file>

[root@localhost ~]# cp anaconda-ks.cfg filel

2. To verify that the data has been copied

[root@localhost ~]# cat filel

Result:

# System authorization information


auth --enableshadow --passalgo=sha512

# Use CDROM installation media cdrom


# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts-us1
# System language
lang en_US.UTF-8

3. To copy folders

Syntax:

[root@localhost ~]# cp <options> <source_dir> <destination_dir>

-r (recursive)

-v (verbose)

-p (permissions)

[root@localhost ~]# cp -rvp mcse Desktop

Result:

'mcse' -> 'Desktop/mcse'

Verification:

[root@localhost ~]# Is Desktop


mcse

LINUX Lab Manual Page | 24 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

4. To rename directories and files

Syntax:

[root@ local host ~]# mv <source_name> <new_name>

[root@localhost ~]# mv zoomgroup zoomtech

Verification

[root@localhost ~]# Is

anaconda-ks.cfg CCIE CCNP CCNA Desktop Downloads Documents

Ethical Hacking initial-setup-ks.cfg Templates mcse Music Public Pictures Videos zoomtech

5. To move directories and files

Syntax:

[root@ local host ~]# mv <source_file/folder> <destination_dir>

[root@localhost ~]# mv /root/CCNA /opt

Verification

[root@localhost ~]# Is /opt

CCNA

6. To filter the single word from a file

Syntax:

[root@localhost ~]# grep <string> <file_name>

[root@localhost ~]# grep root /etc/passwd

Verification

/etc/passwd:root:x:0:0:root:/root:/bin/bash

7. To see the type of file

[root@localhost ~]# file *

Verification

NameTvpe
Desktop Directory
anaconda.cfg ASCII text
filel ASCII text

LINUX Lab Manual Page | 25 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

CCIE Empty

8. To view and change the date and time

Syntax:

[root@ local host ~]# date -s " Day/mm/dd/hh:mm:ss/year"

-s (string)

[root@localhost ~]# date

Result:

fri Aug 14 10:10:10 ist 2015

[root@ local host ~]# date -s "sat Aug 15 10:20:10 ist 2015"

Verification:

Day/mm/dd/hh:mm:ss/year

sat Aug 15 10:20:10 ist 2015

9. To view the calendar for complete year in screen order

[root@localhost ~]# cal 2015 | less

## OR ##

[root (5) I oca I host ~]# cal 2015 | more

Note: use q option to quit from screen order mode

10. To get help on a particular command with man

Syntax:

[root@ local host ~]# man <command_name>

[root@localhost ~]# man mkdir

Note: use q option to quit from man page

11. To find the location of an object

Syntax:

[root@ local host ~]# find <source_dir> <options> <searching_file/folder>

-iname case insensitive

LINUX Lab Manual Page | 26 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@ local host ~]# find / -iname anaconda-ks.cfg

Result:

/root/anaconda-ks.cfg

12. To count words, lines and characters of file

Syntax:

[root@localhost ~]# wc <filename>

[root@localhost ~]# wc anaconda-ks.cfg

Result:

66 154 1805 anaconda-ks.cfg

LINUX Lab Manual Page | 27 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 4: VISUAL INTERFACE (VI EDITOR)

OBJECTIVE:

To create, edit and modify text files with VI editor

PRE-REQUISITE:

Linux machine with VI editor

TOPOLOGY:

LINUX Lab Manual Page | 28 www.zoomgroup.com

0
1. Modify the file by using vi command

Syntax:

[root@localhost~]# vi <filename>

[root@localhost~]# vi zoomfile

2. Commands to go from command mode to insert mode

i - inserts the text at current cursor position


I - inserts the text at beginning of line
a - appends the text after current cursor
A - appends the text at end of line
o - inserts a line below current cursor
0 - inserts a line above current cursor
r - replace a single char at current cursor

3. Commands in execute mode

:q - quit without saving


:q! - quit forcefully without saving
:w - save
:wq - save and quit
:wq! - save and quit forcefully
:x - save and quit
:sh - Provides temporary shell
:se nu - Setting line numbers
:se nonu - Removing line numbers
:84 - Press enter goes to line

4. To find and replace words

l,$s/<findword>/<replaceword>/gc
: l,$s/world/u niverse/gc
1-- To start the search at from 1st line
$ -> End of File
s -> substitute
g -> global
c -> confirmation

LINUX Lab Manual Page | 29 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

5. Commands in command mode

dd - Deletes a line
2dd - Deletes 2 lines
yy - Copy a line
2yy - Copies 2 lines
p - put (deleted or copied text)
u - Undo (can undo 1000 times)
Ctrl+r - Redo
G - Moves cursor to last line of file
5G - Moves cursor to 5th line of file
Shift+ZZ - save and quit
/<find word> - locate word

LINUX Lab Manual Page | 30 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 5: USER ADMINISTRATION

OBJECTIVE:

To create a new user, modify and delete user accounts

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 31 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

1. Adding a new user

Syntax:

[root@localhost~]# useradd <username>

[root@localhost~]# useradd Tom

2. To filter single user properties

[root@localhost~]# grep Tom /etc/passwd

Result:
Tom: x: 1000:1000:/home/Tom:/bin/bash

3. To check last 10 lines of /etc/passwd

[root@ local host ~]# tail /etc/passwd

Result:

rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin
radvd:x:75:75:radvd user:/:/sbin/nologin
chrony:x:994:993::/var/lib/chrony:/sbin/nologin
pulse:x:171:171:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin
gdm:x:42:42::/var/lib/gdm:/sbin/nologin
gnome-initial-setup:x:993:991::/run/gnome-initial-setup/:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
Tom:x:1000:1000::/home/Tom:/bin/bash

4. To check top 10 lines of user's file

[root@localhost ~]# head /etc/passwd

Result:
root:x:0:0:root:/root:/bin/bash
bin:x:l:l:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:ll:0:operator:/root:/sbin/nologin

LINUX Lab Manual Page | 32 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. To assign password on Tom user

Syntax:

[root@ local host ~]# passwd <username>

[root@localhost ~]# passwd Tom

Changing password for user Tom.


New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

6. To check password properties of Tom user

[root@ local host ~]# grep Tom /etc/shadow

Result:

Tom:$6$IWiNPPn9$uBA.bikWMOG7Z/VI.JOAZoYOzW07yph.3WzltdX2.urlqEchlxTIOPpWvpEQ5

RZrm7rVm.ltB6rxhdPy/AWcN 1:16677:0:99999:7:::

LINUX Lab Manual Page | 33 www.zoomgroup.com

0
Verification:

Open another gui console to login with new user

[root@localhost ~]# gdmflexiserver

Select Tom username

Providing Tom password


0*0

Tom

Ctncfl O Sign In

LINUX Lab Manual Page | 34 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

Opening a terminal in Tom console


•A Application* Place* A - Sgn231S O Tom

Organize Desktop by Name

Keep Aligned

Change Desktop Background

Adding data as a Tom user


** Application* Placet Br tin jl ♦ £ Sun 2S:l» O Tom

Note: To check Tom user data move to root user console by using ctrl+alt+fl and check in his

home directory.

Verification:

[root@localhost ~]# Is /home/Tom


Desktop Downloads Pictures Templates zooml zoom2 zoom4 zoom6 zoom8
Documents Music Public Videos zoomlO zoom3 zoom5 zoom7 zoom9

LINUX Lab Manual Page | 35 www.zoomgroup.com

0
Modifying an existing user's properties

Syntax:

[root@localhost~]# usermod <option> <arguments> <username>

-u 2001 (changing user id)


-c "Manager of sales dept" (changing new comment)
-d /salesdept (changing new directory)
-s /bin/csh (changing an user shell)
-I /bin/csh (changing an user login name)
-L /bin/csh (To lock a user account)
-U /bin/csh (To unlock a user account)

1. Changing uid of an existing user

Syntax:

[root@localhost~]# usermod -u <uid> <username>

[root@localhost~]# usermod -u 2001 Tom

Verification:

[root@localhost~]# grep Tom /etc/passwd

Tom: x: 2001:1000: /home/Tom:/bin/bash

[root@localhost~]# su - Tom

[Tom@localhost~]$ id

uid=2001(Tom) gid=1001(Tom) groups=1001(Tom)

context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.cl023

[Tom@localhost~]$ exit

logout

2. Changing comment of an existing user

Syntax:

[root@localhost~]# usermod -c <comment> <username>

[root@localhost~]# usermod -c "Manager of sales dept" Tom

Verification:

[root@localhost~]# grep Tom /etc/passwd

LINUX Lab Manual Page | 36 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

Tom: x: 2001:1000: Manager of sales dept:/home/tom:/bin/bash

3. Changinguser home directory

Adding new directory according username in an existing directory

[root@localhost~]# mkdir -p /salesdept/Tom

Syntax:

[root@localhost~]# usermod -d <directory> <username>

[root@localhost~]# usermod -d /salesdept/Tom Tom

Copying bash files from default directory into user home directory

[root@ local host"]# cp -rvp /etc/skel/. /salesdept/Tom

Verification:

[root@localhost~]# grep Tom /etc/passwd

Tom:x:2001:1000:"Manager of Sales Dept":/salesdept/Tom:/bin/bash

[root@localhost~]# su - Tom

[Tom@localhost~]$ pwd

/salesdept/Tom

[Tom@localhost~]$ exit

logout

4. Change an existing user shell

Syntax:

[root@localhost~]# usermod -s <new shell> <username>

[root@localhost~]# usermod -s /bin/ksh Tom

Verification:

[root@ local host"]# grep Tom /etc/passwd

Tom:x:2001:1000:"Manager of Sales Dept":/Salesdept/Tom:/bin/ksh

LINUX Lab Manual Page | 37 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

[root@localhost~]# su - Tom

$ echo $SHELL

/bin/ksh

$ exit

logout

5. To change an existing user's login name

Syntax:

[root@ local host ~]# usermod -I <new name> <old name>

[root@localhost ~]# usermod-I John Tom

Verification:

[root@localhost ~]# grep John /etc/passwd

John:x:2001:1000:Manager of sales dept:/salesdept/Tom:/bin/ksh

Note: User home directory will not be changed, only username will change

[root@localhost ~]# gdmflexiserver

Result:

User is logging with new name


Mon 00*16 0* 0

John

PAVAfOia

CancH (’ hi

6. To Lock the Account

Syntax:

LINUX Lab Manual Page | 38 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

[root@localhost ~]# usermod -L <username>

[root@localhost ~]# usermod -L John

Verification:

[root@localhost ~]# grep John /etc/shadow

John:!$6$xylJN65M$iK6FLYNX01DcBfmnc9Ea23MljYdggkdpwMH7qcA3m4ZrP0dgKmlhDqr8Zh

Y6gkmNy3scVrqazV2DjVvh.JZFL/: 16677:0:99999:7:::

Note: (!) Exclamation mark is a sign of Locked user

[root@localhost ~]# gdmflexiserver

Result:

Username John not displayed because that account has been locked
HxiM-H 0*0

7. To Unlock the Account

Syntax:

[root@localhost ~]# usermod -U <username>

[root(§> local host ~]# usermod -U John

Verification:

[root@localhost ~]# grep John /etc/shadow

John:$6$xylJN65M$iK6FLYNX01DcBfmnc9Ea23MljYdggkdpwMH7qcA3m4ZrP0dgKmlhDqr8Zh

Y6gkmNy3scVrqazV2DjVvh.JZFL/: 16677:0:99999:7:::

Note: (l)Exclamation mark will be removed once the user account is unlocked.

LINUX Lab Manual Page | 39 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

[root@localhost ~J# gdmflexiserver

Result:

Username John is displayed and by using that name user John can login
MonOO-SO O « O

John

LINUX Lab Manual Page | 40 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

To add new user with all new properties

Syntax:

[root@localhost~]# useradd -u <uid> -c <comment> -d <newdir> -s <newshell> <username>

[root@localhost~]# useradd -u 2002 -c "Admin" -d /salesdept/Ali -s /bin/csh AM

Verification:

[root@localhost~]# grep Ali /etc/passwd

Ali:x:2002:1003:Admin:/salesdept/Ali:/bin/csh

8. To delete user John without deleting his home directory

Syntax;

[root@localhost ~]# userdel <username>

[root@localhost ~]# userdel John

Verification:

[root@localhost ~]# Is /home

Note: User directory will not be deleted

[root@localhost ~]# grep John /etc/passwd

Result:

No user properties are shown

9. To delete user along with his home directory

Syntax:

[root@ local host ~]# userdel -r <username>

[root@localhost ~]# userdel -r Ali

Verification:

[root@localhost ~]# Is /home

Note: User directory will also be deleted

[root@ local host ~]# grep Ali /etc/passwd

Result:

No user properties are shown

LINUX Lab Manual Page | 41 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 6: GROUP ADMINISTRATION

OBJECTIVE:

To create a new group and modify an existing group's properties

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 42 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

1. To add new group

Syntax:

[root@localhost ~]# groupadd <groupname>

[root@localhost ~]# groupadd zoomtech

Verification:

[root@localhost ~]# grep zoomtech /etc/group

zoomtech:x:1000:

2. To assign password to a group

Syntax:

[root@ local host ~]# gpasswd <groupname>

[root@localhost ~]# gpasswd zoomtech

Changing the password for group zoomtech


New Password:
Re-enter new password:

Verification:

[root@localhost ~]# grep zoomtech /etc/gshadow

zoomtech :$6$KoqFT/.FII$TKrAHtcPHa7iEvOc/YG7AvBeELtngSRZWWzxxOODc/rOKlNyi5wfekM

wqdl0HNz5.NDCAIty6wghkCC2ld6J70::

3. Changing the name of an existing group (from zoomtech to zoomgroup)

Syntax:

[root@ local host ~]# groupmod -n <new_name> <old_name>

[root@localhost ~]# groupmod -n zoomgroup zoomtech

Verification:

[root@localhost ~]# grep zoomgroup /etc/group

zoomgroup:x:1000:

0
ZOO IV
TECH N OLOG IE

4. To add single user in a group

Note: Before you add user into group create a user

[root@localhost ~]# useradd jack

Syntax:

[root@localhost ~]# gpasswd -a <username> <groupname>

[root@localhost ~]# gpasswd -a jack zoomgroup

Adding user Jack to group zoomgroup

Verification:

[root@localhost ~]# grep zoomgroup /etc/group

zoomgroup:x:1000:jack

5. To add multiple users in a group

Note: Before you add user into group create some users

[root@localhost ~]# useradd wiliam

[root@localhost ~]# useradd sam

Syntax:

[root@localhost~]# gpasswd -M <userl>,<user2>,<user3> <group_name>

[root@localhost ~]# gpasswd -M jack,sam,wiliam zoomgroup

Verification:

[root@localhost ~]# grep zoomgroup /etc/group

zoomgroup:x:1000:jack;sam;wiliam

6. To add user in a group as a Secondary member

Note: Before you add user into group create a user

[root@localhost ~]# useradd ravi

Syntax:

[root@localhost ~]# usermod -G <groupname> <username>

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# usermod -G zoomgroup ravi

Verification:

[root@localhost ~]# grep zoomgroup /etc/group

zoomgroup:x:1000:jack;sam,wiliam,ravi

7. To add user in a group as a primary member

Note: Before you add user into group create a user

[root@localhost ~]# useradd Ali

Syntax:

[root@localhost ~]# usermod -g <groupname> <username>

[root@ local host ~]# usermod -g zoomgroup Ali

Verification:

[root@localhost ~]# su - Ali

[Ali@localhost~]$ id

uid=1004(Ali) gid=1000 (zoomgroup) groups=1000(zoomgroup)

context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.cl023

8. Removing user wiliam from zoomgroup

Syntax:

[root@localhost ~]# gpasswd -d <user_name> <group_name>

[root@localhost ~]# gpasswd -d wiliam zoomgroup

Verification:

[root@localhost ~]# grep zoomgroup /etc/group

zoomgroup^lOOCkjackjSarrvavi

LINUX Lab Manual Page | 45 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

9. Deleting a group

Syntax:

[root@localhost ~]# groupdel <group_name>

[root@localhost ~]# groupdel zoomgroup

Note: If group contains any primary member, it cannot be deleted unless the gid of that
member is changed.

Verification:

[root@ local host ~]# grep zoomgroup /etc/group

No group details will be displayed.

LINUX Lab Manual Page | 46 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 7: PERMISSIONS

OBJECTIVE:

To assign permissions for files and directories

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 47 www.zoomgroup.com

0
1. Adding a new directory(folder)

[root@localhost ~]# mkdir /myfolder

[root@localhost ~]# cd /myfolder/

2. Adding new file in directory

[root@localhost myfolder]# touch test_file

3. To check working username

[root@localhost myfolder]# whoami

Result:

root

4. To check an existing file/dir default permissions

[root@localhost myfolder]# Is -Id test_file

-rw-r--r--1 root root 0 sep 1 00:06 test_file

5. Set write permissions to the group level only by using Symbolic Mode

Syntax:

[root@localhost myfolder]# chmod <permission_mode> <file/dir_name>

[root@localhost myfolder]# chmod g+w test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

-rw-rw-r--1 root root 0 Sep 1 00:06 test_file

6. Remove read permissions for others only by using symbolic mode

[root@localhost myfolder]# chmod o-r test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

-rw-rw— 1 root root 0 Sep 1 00:06 test_file

LINUX Lab Manual Page | 48 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

7. Assign read, write and execute permissions to others only by using symbolic mode

[root@localhost myfolder]# chmod o=rwx test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

.,-rw-rw-rwx 1 root root 0 Sep 1 00:06 test_file

8. Assign execute permissions to owner, group and others by using symbolic mode

[root@localhost myfolder]# chmod +x test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

-rwxrwxrwx 1 root root 0 Jul 13 00:06 test_file

9. Remove write and execute permissions from group and others also.

[root@localhost myfolder]# chmod g-wx,o-wx test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

-rw-r-r-1 root root 0 Sep 1 00:06 test_file

10. Assign write permissions to others by using Absolute Mode(Numeric Mode)

Syntax:

[root@ local host myfolder]# chmod <permission_modexfile/dir>

[root@localhost myfolder]# chmod 646 test_file

Verification:

[root@localhost myfolder]# Is -Id test_file

-rw-r--rw-1 root root 0 sep 1 00:06 test_file

11. Assign full permissions to owner, group and others on admin directory using Absolute Mode

[root@localhost ~]# chmod 777 /root

#### OR #####

12. Assign full permissions to owner, group and others on admin directory using Symbolic Mode

LINUX Lab Manual Page | 49 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# chmod u+rwx,g+rwx,o+rwx /root

13. To find result, add a normal user and try to access file as a normal user

[root@localhost myfolder]# useradd zoomuser

[root@localhost myfolder]# su - zoomuser

[zoomuser@localhost ~]$ cd /root/myfolder

Verification:

[zoomuser@localhost myfolder]$ cat»test_file

This is a zoom user file

Ctrl+d (to save data)

[zoomuser@localhost myfolder]$ cat test_file

This is a zoom user file

Verification:

[root@localhost ~]# Is-ld /root

drwxrwxrwx 2 root root 4096 Sep 1 02:22 /root

Note: user can read and write in file because file is having read and write permissions on
other level

LINUX Lab Manual Page | 50 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 8: ACCESS CONTROL LIST

OBJECTIVE:

To assign permissions for files/folders belonging to different users and groups using Access Control

Lists.

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 51 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. Create some users

[root@localhost ~]# useradd tom

[root@localhost ~]# useradd jack

[root@localhost ~]# useradd john

[root@localhost ~]# useradd ali

[root@ local host ~]# useradd ravi

[root@localhost ~]# useradd ram

2. To find the properties of the newly created users ( 6 users):

[root@localhost ~]# tail -6 /etc/passwd

tom:x:1000:1000::/home/tom:/bin/bash

jack:x:1001:1001::/home/jack:/bin/bash

john:x:1002:1002::/home/john:/bin/bash

ali:x:1003:1003::/home/ali:/bin/bash

ravi:x:1004:1004::/home/ravi:/bin/bash

ram:x:1005:1005::/home/ram:/bin/bash

3. Create a new group

[root@localhost ~]# groupadd salesgrp

4. To add users into group

[root@localhost ~]# gpasswd -M ali,ravi,ram salesgrp

Verification:

[root@localhost ~]# grep salesgrp /etc/group

salesgrp:x:1006:ali,ravi,ram

LINUX Lab Manual Page | 52 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. Create a file by using 'cat' command

[root@localhost ~ ]# cat > zoom

This file is added by root user


Ctrl+d (to save data)

6. To apply ACL permissions for file/folder for individual users

Syntax:

[root@localhost ]# setfacl -m u:<username>:<permissions> <file/folder>


-m (modify)
[root@localhost ~]# setfacl -m u:tom:rw zoom

[root@localhost ~]# setfacl -m u:jack:r zoom

[root@ local host ~]# setfacl -m u:john:0 zoom

7. To apply ACL permissions for file/folder for groups

Syntax:

[root@localhost ]# setfacl -m g:<groupname>:<permissions> <file/folder>

[root@localhost ~]# setfacl -m g:salesgrp:rw zoom

8. To check the list of ACL permissions of files/folders

Syntax:

[root@localhost ~]# getfacl <filename>

Verification:

[root@localhost ~]# getfacl zoom

# file: zoom
# owner: root
# group: root
user::rw-
user:tom:rw-
user:jack:r--
usenjohn:—
group::r--
group:salesgrp:rw-
mask::rw-
other::r--

LINUX Lab Manual Page | 53 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

9. To exclude user Tom from ACL list

Syntax:

[root@localhost ~]# setfacl -x u:<username> <filename>

[root@localhost ~]# setfacl -x u:tom zoom

Verification

[root@localhost ~]# getfacl zoom

# file: zoom
# owner: root
# group: root
user::rw-
user:jack:r--
user:john:—
group::r--
group:salesgrp:rw-
mask::rw-
other::r--

10. Check the output by logging in as a user jack

[root@localhost ~]# su - jack

[jack@localhost ~]$ cd /root (to enter into root user dir)

[jack@localhost~]$ cat zoom

Result:

This file is added by root user

[jack@localhost ~]$ cat » zoom

Result:

-bash: zoom: Permission denied

Because jack has only read permissions

Note: Similarly login as different users and group members to test the Access List.

LINUX Lab Manual Page | 54 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 9: CHANGE OWNERSHIP OF FILES AND DIRECTORIES

OBJECTIVE:

To change owners of files/folders .

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 55 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. Create a new user

[root@localhost ~]# useradd sam

2. To give ownership of a file to another user

Syntax:

[root@localhost ~]# chown <username> <file/folder>

[root@localhost ~]# chown sam zoom

Verification

[root@localhost ~]# Is -Id zoom

-rw-r-r- 1 sam root 32 Aug 31 09:46 zoom

3. Check the result by logging in as user sam

[root@localhost~] su - sam

[sam@localhost ~]$ cd /root (to enter into root user dir)

[sam@localhost~]$ cat zoom

Result:

This file is added by root user

[sam@localhost ~]$ cat » zoom (try to read)

Sam is a good boy

ctrl+d (to save)

[sam(5)localhost~]$ cat zoom (try to read)

Result:

This file is added by root user

Sam is a good boy

LINUX Lab Manual Page | 56 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

LAB 10 : CHANGE GROUP OWNER OF FILES AND DIRECTORIES

OBJECTIVE:

To change the group owner of a file/folder.

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

0
ZOOM
.TECHNOLOGIES.

1. Create a group

[root@localhost ~]# groupadd techgrp

2. Create some users

[root@localhost ]# useradd kumar

[root@localhost ]# useradd vali

3. Add users in a group

[root@localhost ]# gpasswd -M kumar,vali techgroup

Verification

[root@localhost]# grep techgroup /etc/group

Techgrp:x:1000:kumar,vali

4. To change group owner of a file

Syntax:

[root@localhost ~]# chgrp <group_name> <file/folder>

[root@localhost ~]# chgrp techgrp zoom

5. To give write permissions to group owner on file

[root@localhost ~]# chmod g+w zoom

Verification:

[root@localhost ~]# Is -Id zoom

-rw-rw-r--1 sam techgrp 32 Aug 31 09:46 zoom

6. Check the result by logging in as a techgrp user

[root@localhost~] su - vali

[vali@localhost ~]$ cd /root (to enter into root user dir)

[vali@localhost~]$ cat zoom

LINUX Lab Manual Page | 58 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Result:

This file is added by root user

Sam is a good boy

[vali@localhost~]$ cat» zoom

Vali is a good boy

Ctrl+d (to save)

[vali@localhost~]$ cat zoom

This file is added by root user

Sam is a good boy

Vali is a good boy

LINUX Lab Manual Page | 59 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 11: PARTITIONS

OBJECTIVE:

To create a new partition on the hard disk

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 60 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

1. Check the existing partitions on the hard disk

Syntax:

[root@clientl ~]# fdisk <option>

[root@clientl ~]# fdisk -I

Result:

Disk/dev/sda: 41.9 GB, 41875931136 bytes, 81788928 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris

2. Enter the hard disk by using fdisk command

[root@clientl ~]# fdisk /dev/sda

Command (m for help): m


d delete a partition
m print this menu
n add a new partition
p print the partition table
q quit without saving changes
w write table to disk and exit

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n


First cylinder (1098-2434, default 1098): Press enter (key to skip cylinders option)
Using default value 1098
Last cylinder or +size or +sizeM or +sizeK (1098-2434, default 2434): +100M (partition size)

LINUX Lab Manual Page | 61 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Command (m for help): p (to print new changes)


Disk/dev/sda: 41.9 GB, 41875931136 bytes, 81788928 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 1024 83 Linux

Partition table entries are not in disk order

Command (m for help): w (to save and quit)

The partition table has been altered!

Calling ioctlQ to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

3. Update new partition changes to kernel

Syntax:

[root@clientl ~]# partprobe <disk_name>

[root@clientl ~]# partprobe /dev/sda

Verification:
No error message means updated successfully

LINUX Lab Manual Page | 62 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

[root@clientl ~]# fdisk -I

Disk/dev/sda: 41.9 GB, 41875931136 bytes, 81788928 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 102400 83 Linux

4. Make file system i.e... (format the partition)

Syntax:

[root@clientl ~]# mkfs.ext4 <partition no>

[root@clientl ~]# mkfs.ext4 /dev/sda8

Result:
mke2fs 1.42.9 (28-Dec-2013)

Filesystem too small for a journal


Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=l
Maximum filesystem blocks=1048576
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group

Allocating group tables: done

LINUX Lab Manual Page | 63 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Writing inode tables: done


Writing superblocks and filesystem accounting information: done

########## OR ##########

[root@clientl ~]# mkfs.vfat /dev/sda8

Result:

mkfs.fat 3.0.20 (12 Jun 2013)

5. To check file system type of partition

[root@clientl ~]# blkid /dev/sda8

Result:

/dev/sda8: UUID=M08b85639-6ce3-4d4c-8d55-19c24ab0756aM TYPE=Mext4M

6. Create a folder and mount the partition to use

[root@clientl ~]# mkdir/mnt/linux

Syntax:

[root@clientl ~]# mount <partition_no.> <directory>

[root@clientl ~]# mount /dev/sda8 /mnt/linux

7. Check the mounted partition

[root@clientl ~]# mount | grep/mnt/linux

/dev/sda8 on /mnt/linux type ext4 (rw,relatime,seclabel)

LINUX Lab Manual Page | 64 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

8. Write the data on the partition

[root@clientl ~]# cd /mnt/linux

[root@clientl linux]#

[root@clientl linux]# touch myfile myfill myfiie2

[root@clientl linux]# mkdir dsnr secbad bhills ameerpet

[root@clientl linux]# Is

ameerpet bhills dsnr lost+found myfile myfilel myfile2 secbad

LINUX Lab Manual Page | 65 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

LAB 12: SWAP PARTITION (VIRTUAL MEMORY)

OBJECTIVE:

To create a swap partition for faster performance .

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 66 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. Check the RAM size

[root@clientl ~]# free -m

Result:
total used free shared buffers cached
Mem: 979 918 61 1 0 55
-/+ buffers/cache: 862 117
Swap: 1999 1173 826

2. Create a new partition twice the size of RAM

[root@clientl ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n (to add new partition>


First cylinder (1098-2434, default 1098): Press enter key to skip cylinders size
Using default value 1098
Last cylinder or +size or +sizeM or +sizeK (1098-2434, default 2434): +2GB (partition size)
Command (m for help): t (to change the partition ID)

Partition number (1-9, default 9): 9

Hex code (type L to list all codes): 82 (assigning swap code value)

Changed type of partition 'Linux' to 'Linux swap / Solaris'


Command (m for help): w (to save new changes)
The partition table has been altered!

Calling ioctlQ to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

LINUX Lab Manual Page | 67 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

3. Update new partition changes to kernel

Syntax:

[root@clientl ~]# partprobe <device_name>

[root@clientl ~]# partprobe /dev/sda

Verification:

No error message means updated successfully

[root@clientl ~]# fdisk -I

Disk/dev/sda: 41.9 GB, 41875931136 bytes, 81788928 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/ 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 102400 83 Linux
/dev/sda9 62683136 66588671 1952768 82 Linux swap / Solaris

4. Format the partition by using swap filesystem

Syntax:

[root@clientl ~]# mkswap <partition_no.>

[root@clientl ~]# mkswap /dev/sda9

Result:

Setting up swapspace version 1, size = 1952764 KiB

no label, UUID=0b6c9b8f-b4a9-45bf-bf90-14a076cd334e

LINUX Lab Manual Page | 68 www.zoomgroup.com

0
5. Turn on the swap partition

Syntax:

[root@clientl ~]# swapon <partition_no.>

[root@clientl ~]# swapon /dev/sda9

6. To see the swap partition status

[root@clientl ~]# swapon -s

Result:
Filename Type Size Used Priority
/dev/sda7 partition 2047996 1225984
/dev/sda9 partition 1952764 0

7. Check the newly added swap partition size

Verification

[root@clientl ~]# free -m

total used free shared buffers cached


Mem: 979 909 70 1 0 40
-/+ buffers/cache: 868 111
Swap:3906 1197 2709

8. To Turn Off the swap partition

[root@clientl ~]# swap off /dev/sda9

Result:

[root@clientl ~]# swapon -s

Filename Type Size Used Priority

/dev/sda7 partition 2047996 1225984 -1

Note:/dev/sda9 swap partition is not displayed

LINUX Lab Manual Page | 69 www.zoomgroup.com

0
LAB 13: DISK LABEL

OBJECTIVE:

To Label a Disk

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 70 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To Assign label name on partition

Syntax:

[root@clientl ~]# e2label <partition_no.> <label_name>

[root@clientl ~]# e2label /dev/sda8 /songs

2. To check label name of partition

Syntax:

[root@clientl ~]# e2label <partition_no.>

[root@clientl ~]# e2label /dev/sda8

Result:

/songs

3. Mounting the partition with label name

Syntax

[root@clientl ~]# mount LABEL=<label_name> <directory_name>

[root@clientl ~]# mount LABEL=/songs /myfolder

4. Check mount point with label

[root@clientl ~]# mount -I | grep /songs

Result:

/dev/sda8 on /myfolder type ext4 (rw,relatime;data=ordered)[/songs]

5. Permanently mounting the partition with label name

[root@clientl ~]# vi /etc/fstab

LABEL=/songs /myfolder ext4 defaults 0 0

wq:

LINUX Lab Manual Page | 71 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

6. To see the utilization of disk space

[root@clientl ~]# df -hT

Result:

Filesystem Type Size Used Avail Use% Mounted on


/dev/sda3 ext4 7.6G HIM 7.1G 2% /
devtmpfs devtmpfs 482M 0 482M 0% /dev
tmpfs tmpfs 490M 14 M 477M1 3% /run
/dev/sda5 ext4 7.6G 3.7G 3.6G 52% /usr
/dev/sdal ext4 477M 77M 371M 18% /boot
/dev/sda2 ext4 9.5G 130M 8.9G 2% /var
/dev/sda6 ext4 1.9G 6.1M 1.8G 1% /home
/dev/srO iso9660 6.6G 6.6G 0 100% /run/media/root/CentOS
/dev/sda8 ext4 93M 1.6M 85M 2% /mnt/linux

7. To see the block size.

Syntax:

[root@clientl ~]# blockdev --getbsz <partition_no.>

[root@clientl ~]# blockdev --getbsz /dev/sda9

Result:

4096

LINUX Lab Manual Page | 72 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 14 : DISK QUOTAS

OBJECTIVE:

To allocate disk space to users and groups

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 73 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. Create the required partition for disk quotas

[root@localhost ~]# fdisk -I

Result:

Disk/dev/sda: 41.9 GB, 41875931136 bytes, 81788928 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 102400 83 1.inux
/dev/sda9 62683136 66588671 1952768 82 Linux swap / Solaris

2. Add the new partition

[root@localhost ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n


First cylinder (2315-4865, default 2315):
Using default value 2315
Last cylinder or +size or +sizeM or +sizeK (2315-4865, default 4865): +100M
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

LINUX Lab Manual Page | 74 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Command (m for help): w (to save and quit)

The partition table has been altered!

Syncing disks.

3. Update the new changes to kernel

[root@localhost ~]# partprobe /dev/sda

Verification:

No error message means updated successfully

4. View the newly added partition

[root@localhost ~]# partprobe /dev/sda

Verification:
/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda 3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda 6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 102400 83 Linux
/dev/sda9 62476288 66381823 1952768 82 Linux swap / Solaris
/dev/sdalO 66383872 66588671 102400 83 Linux

5. Format the partitionby using filesystem

[root@localhost ~]# mkfs.ext4 /dev/sdalO

6. Create a new directory to mount the quota partition

[root@localhost ~]# mkdir /salesdept

7. Mount the partition with user and group quota parameters.

Syntax:

[root@localhost ~]# mount -o <usrquota,grpquota> <partition_no> <directory_name>

LINUX Lab Manual Page | 75 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# mount -o usrquota,grpquota /dev/sdalO /salesdept

8. Check only the mount point of quota partition

[root@localhost ~]# mount | grep /salesdept

Result:

/dev/sdalO on /salesdept type ext4

(rw;relatime,seclabel;quota,usrquota;grpquota;data=ordered)

9. Give full permissions on quota partition

[root@localhost ~]# chmod 777 /salesdept/

[root@localhost ~]# Is -Id /salesdept

Result:

drwxrwxrwx. 3 root root 1024 Sep 111:54 /salesdept

10. Create the Quota Database on partition

Syntax:

[root@ local host ~]# quotacheck <options> <mount_point>

-c (create)

-u (user level)

-g (group level)

-v (verbose)

[root@localhost ~]# quotacheck -cugv /salesdept

subtracted.
quotacheck: Checked 2 directories and 0 files
quotacheck: Old file not found,
quotacheck: Old file not found.

Verification:

[root@localhost ~]# Is /salesdept

aquota.group aquota.user lost+found

LINUX Lab Manual Page | 76 www.zoomgroup.com

0
ZOOM
\TECH N OLOG IES

11. Check the quota Status

Syntax:

[root@localhost~]# quotaon -p <mount_point>

Verification:

[root@localhost ~]# quotaon -p /salesdept

group quota on /salesdept (/dev/sdalO) is off

user quota on /salesdept (/dev/sdalO) is off

12. Enable the quota on partition

Syntax:

[root@ local host ~]# quotaon <mount_point>

[root@localhost ~]# quotaon /salesdept

Verification:

[root@localhost ~]# quotaon -p /salesdept

group quota on /salesdept (/dev/sdalO) is on

user quota on /salesdept (/dev/sdalO) is on

13. Create users and groups

[root@localhost ~]# useradd tom

[root@localhost ~]# groupadd salesgrp

[root@localhost ~]# groupadd fingrp

14. Add users as a primary member in groups

[root@localhost ~]# useradd -g salesgrp sai

[root@localhost ~]# useradd -g salesgrp ram

15. Apply quota on a user tom

Syntax:

[root@localhost ~]# edquota -u <username>

LINUX Lab Manual Page | 77 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# edquota -u tom

Result:

Disk quotas for user tom (uid 1000):

Filesystem blocks soft hard inodes soft hard


/dev/sdalO 0 0 0 0 3 5

:wq(save and quit)

16. To check result,login as user tom

[root@localhost ~]# su - tom

[tom@localhost ~]$ cd /salesdept/

[tom@localhost salesdept]$ II

Result of quota files:

-rw . 1 root root 6144 Sep 112:05 aquota.group

-rw . 1 root root 6144 Sep 112:05 aquota.user

drwx . 2 root root 12288 Sep 111:54 lost+found

[to m@ I oca I host salesdept]$ touch filel

[tom(S>localhost salesdept]$ touch file2

[tom (5) I oca I host salesdept]$ touch file3

[tom@localhost salesdept]$ touch file4

Result:

sdalO: warning, user file quota exceeded.

[tom@localhost salesdept]$ touch file5

[tom@localhost salesdept]$ touch file6

Result:

sdalO: write failed, user file limit reached.

mkdir: cannot create directory 'file6‘: Disk quota exceeded

LINUX Lab Manual Page | 78 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

17. Apply quota on a group salesgrp which has sai and ram as primary members

Syntax:

[root@localhost ~]# edquota -g <group_name>

[root@localhost ~]# edquota -g salesgrp

Result:

Disk quotas for group salesgrp (gid 1002):

Filesystem blocks soft hard inodes soft hard

/dev/sdalO 0 0 0 5 3 5

:wq!(save and quit)

18. To check result, try to add data as the group member sai

[root@localhost salesdept]# su - sai

[sai@localhost salesdept]$ cd /salesdept (enter into disk quota dir)

[sai@localhost salesdept]$ touch filel file2 file3

[sai@localhost salesdept]$ exit (to logout user)

exit

[root@localhost salesdept]# su - ram

[ram@localhost salesdept]$ cd /salesdept

[ram@localhost salesdept]$ touch file4

sdalO: warning, group file quota exceeded.

[ram@localhost salesdept]$ touch file5

[ram@localhost salesdept]$ touch file6

Result:

sdalO: write failed, group file limit reached,

touch: cannot touch 'file6': Disk quota exceeded

LINUX Lab Manual Page | 79 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[ram@localhost salesdept]$ II

total 36

-rw i root root 7168 Sep 1 01:52 aquota.group

-rw 1 root root 7168 Sep 1 01:53 aquota.user

drwx 2 root root 16384 Sep 1 01:38 lost+found

-rw-r-r- 1 ram salesgrp 0 Sep 1 01:53 file5

-rw-r-r- 1 ram salesgrp 0 Sep 1 01:53 file4

-rw-r--r--1 sai salesgrp 0 Sep 1 01:53 filel

-rw-r--r--1 sai salesgrp 0 Sep 1 01:53 file2

-rw-r--r--1 sai salesgrp 0 Sep 1 01:53 file3

[ram@localhost salesdept]$

Note: Quotas are not applicable on secondary group members

LINUX Lab Manual Page | 80 www.zoomgroup.com

0
LAB 15: LOGICAL VOLUME MANAGER (LVM)

OBJECTIVE:

To resize block storage i.e logical volumes on harddisk, partitions, or SAN storage.

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

0
ZOOM
.TECHNOLOGIES.

1. View hard disk details and list of partitions

Syntax:

[root@localhost ~]# <fdisk-l>

[root@localhost ~]# fdisk -I

Disk/dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b85b7

Device Boot Start End Blocks Id System


/dev/sdal * 2048 616447 307200 83 Linux
/dev/sda2 616448 14952447 7168000 133 Linux
/dev/sda3 14952448 27240447 6144000 83 Linux
/dev/sda4 27240448 62914559 17837056 5 Extended
/dev/sda5 27244544 39532543 6144000 83 Linux
/dev/sda6 39534592 41582591 1024000 83 Linux
/dev/sda7 41584640 43632639 1024000 82 Linux swap / Solaris
/dev/sda8 27242496 27244543 102400 83 Linux
/dev/sda9 43634688 44249087 307200 83 Linux

2. Create partition of required size ,for eg : Two partitions of 300 MB each

Syntax:

[root@ local host ~]# <fdisk <device_name>

[root@localhost ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n


All primary partitions are in use
Adding logical partition 10

LINUX Lab Manual Page | 82 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

First sector (44251136-62914559, default 44251136):


Using default value 44251136
Last sector, +sectors or +size{K,M,G} (44251136-62914559, default 62914559): +300M
Partition 10 of type Linux and of size 300 MiB is set

Command (m for help): n


All primary partitions are in use
Adding logical partition 11
First sector (44867584-62914559, default 44867584):
Using default value 44867584
Last sector, +sectors or +size{K,M,G} (44867584-62914559, default 62914559): +300M
Partition 11 of type Linux and of size 300 MiB is set

Command (m for help): w


The partition table has been altered!

Calling ioctlQ to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

3. Update newly created partitions to kernel without restarting.

Syntax:

[root@localhost~]# partprobe <disk_name>

[root@localhost~]# partprobe /dev/sda

Verification:

No error message means updated successfully

4. Now confirm the list of newly created partitions

[root@localhost ~]# fdisk -I

LINUX Lab Manual Page | 83 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

Verification:

Disk/dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b85b7

Device Boot Start End Blocks Id System


/dev/sdal * 2048 616447 307200 83 Linux
/dev/sda2 616448 14952447 7168000 83 Linux
/dev/sda3 14952448 27240447 6144000 83 Linux
/dev/sda4 27240448 62914559 17837056 5 Extended
/dev/sda5 27244544 39532543 6144000 83 Linux
/dev/sda6 39534592 41582591 1024000 83 Linux
/dev/sda7 41584640 43632639 1024000 82 Linux swap / Solaris
/dev/sda8 27242496 27244543 1024 83 Linux
/dev/sda9 43634688 44249087 307200 83 Linux
/dev/sdalO 44251136 44865535 307200 83 Linux
/dev/sdall 44867584 45481983 307200 83 Linux

5. Create Physical Volumes

Syntax:

[root@localhost ~]# pvcreate <partition_number>

[root@localhost ~]# pvcreate /dev/sdalO /dev/sdall

Result:

Physical volume M/dev/sdal0M successfully created

Physical volume "/dev/sdall" successfully created

6. View the list of Physical Volumes

Syntax:

[root@localhost ~]# pvdisplay <pv_name>

LINUX Lab Manual Page | 84 www.zoomgroup.com

0
ZOOM
\TECH NOLOGIES/

[root@localhost ~]# pvdisplay

Result:

"/dev/sdalO" is a new physical volume of "300.00 MiB"


— NEW Physical volume —
PV Name /dev/sdalO
VG Name
PV Size 300.00 MiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PVUUID 5UVcYc-D20D-3YyC-5KRm-zfNX-c0AY-SCcyeK

"/dev/sdall" is a new physical volume of "300.00 MiB"


— NEW Physical volume —
PV Name /dev/sdall
VG Name
PV Size 300.00 MiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PVUUID jVx5Gd-MA9a-Opwv-DeDO-LYHD-sLet-aeAMke

7. Create Volume Group

Syntax:

[root@localhost ~]# vgcreate <volume_group_namexphysical_volume_name>

[root@localhost ~]# vgcreate zoomgroup /dev/sdalO /dev/sdall

Result:

Volume group "zoomgroup" successfully created

8. Display Volume Group Information.

Syntax:
[root@localhost ~]# vgdisplay

LINUX Lab Manual Page | 85 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE

[root@localhost ~]#vgdisplay

Verification
— Volume group —
VG Name zoomgroup
System ID
Format Ivm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 592.00 MiB
PE Size 4.00 MiB
Total PE 148
Alloc PE / Size 0/0
Free PE / Size 148/592.00 MiB
VG UUID UjE4o2-pTnn-27cA-Mo8n-017W-zvQg-zLm2xATo create logical Volume

9. Create logical Volumes in Volume Group

Syntax:

[root@localhost ~]# Ivcreate <volume_group_name> -L <+size_of_logical_volume> -n

<logical_volume_name>

-L logical volume

-n name of logical volume

[root@localhost ~]# Ivcreate zoomgroup -L +300M -n Ivl

Result:

Logical volume "Ivl" created

LINUX Lab Manual Page | 86 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

10. View Logical Volume details.

Syntax:

[root@localhost ~]# Ivdisplay

[root@localhost ~]# Ivdisplay

Verification:

— Logical volume —
LV Path /dev/zoomgroup/lvl
LV Name Ivl
VG Name zoomgroup
LV UUID dPTAZW-BWck-YsbO-feSU-XUYF-EYn7-PA9GQf
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2015-08-31 13:36:39 +0530
LV Status available
# open 0
LV Size 300.00 MiB
Current LE 75
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0

11. Make filesystem (i.e format) for the Logical Volume

[root@localhost ~]# mkfs.ext4 /dev/zoomgroup/lvl

mke2fs 1.42.9 (28-Dec-2013)


Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
76912 inodes, 307200 blocks
15360 blocks (5.00%) reserved for the super user
First data block=l
Maximum filesystem blocks=33947648
38 block groups
8192 blocks per group, 8192 fragments per group
2024 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185

LINUX Lab Manual Page | 87 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Allocating group tables: done


Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

12. Create a folder and mount the Logical Volume

[root@localhost ~]# mkdir /mylvm

[root@localhost ~]# mount /dev/zoomgroup/lvl /mylvm

13. To check LVM mounted partition

[root@localhost ~]# mount | grep /mylvm

Verification:

/dev/mapper/zoomgroup-lvl on /mylvm type ext4 (rw,relatime,data=ordered)

14. To resize the Logical Volume

Syntax:
[root@ local host ~]# Ivresize -L <+size_of_logical_volume> -n <logical_volume_name>

[root@localhost ~]# Ivresize -L +100M -n /dev/zoomgroup/lvl

Result:
Extending logical volume Ivl to 400.00 MB
Logical volume Ivl successfully resized

15. To check newly created logical volume size had increased.

[root@localhost ~]# Ivdisplay

Verification:
— Logical volume —
LV Path /dev/zoomgroup/lvl
LV Name Ivl
VG Name zoomgroup
LV UUID dPTAZW-BWck-YsbO-feSU-XUYF-EYn7-PA9GQf
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2015-08-31 13:36:39 +0530
LV Status available
#open 1

LINUX Lab Manual Page | 88 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

LV Size 400.00 MiB


Current LE 100
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0 [root@localhost ~]# cd /mylvm

[root@localhost mylvm]# Is
lost+found

16. Now check partition size

[root@localhost ~1# df -h

Result:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 5.7G 68M 5.3G 2%/
devtmpfs 1.5G 0 1.5G 0%/dev
tmpfs 1.5G 80K 1.5G 1%/dev/shm
tmpfs 1.5G 9.0M 1.5G 1%/run
tmpfs 1.5G 0 1.5G 0%/sys/fs/cgroup
/dev/sda5 5.7G 3.6G 1.9G 66%/usr
/dev/sda6 969M 8.5M 894M 1%/home
/dev/sdal 283M 77M 188M 29% /boot
/dev/sda2 6.7G 4.1G 2.2G 65%/var
/dev/mapper/zoomgroup-lvl 283M 2.1M 262M 1%/mylvm

17. We still find the same partition size, so update the kernel. Resize the logical volume at OS

level to update kernel.

Syntax:

[root@localhost ~]# resize2fs <logical_volume_name>

[root@localhost ~]# resize2fs /dev/zoomgroup/lvl

Result:
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/zoomgroup/lvl is mounted on /mylvm; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 4
The filesystem on /dev/zoomgroup/lvl is now 409600 blocks long.

LINUX Lab Manual Page | 89 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# df -h

Result:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 5.7G 68M 5.3G 2%/
devtmpfs 1.5G 0 1.5G 0%/dev
tmpfs 1.5G 80K 1.5G 1%/dev/shm
tmpfs 1.5G 9.0M 1.5G 1%/run
tmpfs 1.5G 0 1.5G 0%/sys/fs/cgroup
/dev/sda5 5.7G 3.6G 1.9G 66%/usr
/dev/sda6 969M 8.5M 894M 1%/home
/dev/sdal 283M 77M 188M 29% /boot
/dev/sda2 6.7G 4.1G 2.2G 65%/var
/dev/mapper/zoomgroup-lvl 380M 2.3M 355M 1%/mylvm
Note: Mounted partition size had increase and updated.

18. Now create some files and folders on logical volume

[root@localhost mylvm]# touch filel file2 file3

[root@localhost mylvm]# mkdir hyd sec

Verification:

[root@localhost mylvm]# Is

filel file2 file3 hyd lost+found sec

19. To extend the volume group, create a new partition and add to volume group.

[root@localhost ~]# fdisk /dev/sda

Command (m for help): n


All primary partitions are in use
Adding logical partition 12
First sector (45484032-62914559, default 45484032):
Using default value 45484032
Last sector, +sectors or +size{K,M,G} (45484032-62914559, default 62914559): +300M
Partition 12 of type Linux and of size 300 MiB is set

Command (m for help): w


The partition table has been altered!

Calling ioctlQ to re-read partition table.

LINUX Lab Manual Page | 90 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

20. Now update kernel

[root@localhost ~]# partprobe /dev/sda

21. To view the list of partitions

[root@localhost ~]#fdisk -I

Disk/dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/ 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b85b7

Device Boot Start End Blocks Id System


/dev/sdal * 2048 616447 307200 83 Linux
/dev/sda2 616448 14952447 7168000 83 Linux
/dev/sda3 14952448 27240447 6144000 83 Linux
/dev/sda4 27240448 62914559 17837056 5 Extended
/dev/sda5 27244544 39532543 6144000 83 Linux
/dev/sda 6 39534592 41582591 1024000 83 Linux
/dev/sda7 41584640 43632639 1024000 82 Linux swap / Solaris
/dev/sda8 27242496 27244543 1024 83 Linux
/dev/sda9 43634688 44249087 307200 83 Linux
/dev/sdalO 44251136 44865535 307200 83 Linux
/dev/sdall 44867584 45481983 307200 83 Linux
/dev/sdal2 45484032 46098431 307200 83 Linux

Partition table entries are :not in disk order

Disk/dev/mapper/zoomgroup-lvl: 419 MB, 419430400 bytes, 819200 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

LINUX Lab Manual Page | 91 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@localhost ~]# pvcreate /dev/sdal2

Result:

Physical volume M/dev/sdal2M successfully created

22. To extend the volume group.

Syntax:

[root@localhost ~]# vgextend <volume_group_name> <physical_volume_name>

[root@localhost ~]# vgextend zoomgroup /dev/sdal2

Result:

Volume group "zoomgroup" successfully extended

Verification:

[root@localhost ~]# vgdisplay


— Volume group —
VG Name zoomgroup
System ID
Format Ivm2
Metadata Areas 3
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 3
Act PV 3
VG Size 888.00 MiB
PE Size 4.00 MiB
Total PE 222
Alloc PE / Size 100/400.00 MiB
Free PE/Size 122/488.00 MiB
VG UUID UjE4o2-pTnn-27cA-Mo8n-017W-zvQg-zLm2xA
Note: Volume group size had increased.

LINUX Lab Manual Page | 92 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

23. To remove logical Volume


Note: First unmount the logical volume then remove it. While unmounting you should not be
in mounted folder.

root@localhost ~]# cd

[root@localhost ~]# umount /mylvm

Verification of removing logical volumes, volume group and physical volumes

[root@localhost ~]# Ivremove /dev/zoomgroup/lvl

Do you really want to remove active logical volume "Ivl"? [y/n]: y

Logical volume "Ivl" successfully removed

[root@ local host ~]# vgremove /dev/zoomgroup

Result:

Volume group "zoomgroup" successfully removed

[root@localhost ~]# pvremove /dev/sda{10..12}

Result:

Labels on physical volume M/dev/sdalO" successfully wiped

Labels on physical volume "/dev/sdall" successfully wiped

Labels on physical volume M/dev/sdal2" successfully wiped

LINUX Lab Manual Page | 93 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 16 : REDUNDANT ARRAY OF INDEPENDENT DISKS (RAID)

OBJECTIVE:

To backup data with RAID 5 Technology

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 94 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To view list of all created partitions

Syntax:

[root@localhost~]# fdisk <option>

[root@ local host ~]# fdisk -I

Verification:

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 1024 83 Linux
/dev/sda9 62476288 66381823 1952768 83 Linux
/dev/sdalO 66383872 66588671 102400 83 Linux

Partition table entries are not in disk order

2. Add some partitions

[root@localhost~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n


All primary partitions are in use
Adding logical partition 11
First sector (66590720-81788927, default 66590720):

LINUX Lab Manual Page | 95 www.zoomgroup.com

0
Using default value 66590720
Last sector, +sectors or +size{K,M,G} (66590720-81788927, default 81788927): +100M
Partition 11 of type Linux and of size 100 MiB is set

Command (m for help): n


All primary partitions are in use
Adding logical partition 12
First sector (66797568-81788927, default 66797568):
Using default value 66797568
Last sector, +sectors or +size{K,M,G} (66797568-81788927, default 81788927): +100M
Partition 12 of type Linux and of size 100 MiB is set

Command (m for help): n


All primary partitions are in use
Adding logical partition 13
First sector (67004416-81788927, default 67004416):
Command (m for help): n
All primary partitions are in use
Adding logical partition 14

Using default value 67004416


Last sector, +sectors or +size{K,M,G} (67004416-81788927, default 81788927): +100M
Partition 13 of type Linux and of size 100 MiB is set

First sector (67004416-81788927, default 67004416):


Using default value 67004416
Last sector, +sectors or +size{K,M,G} (67004416-81788927, default 81788927): +100M
Partition 13 of type Linux and of size 100 MiB is set

Command (m for help): w


The partition table has been altered!

Calling ioctlQ to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

3. Update the newly added partitions to kernel

[root@localhost ~]# partprobe /dev/sda

LINUX Lab Manual Page | 96 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

4. check new added partitions

[root@localhost~]# fdisk -I

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/ 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00040059

Device Boot Start End Blocks Id System


/dev/sdal * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 21506047 10240000 83 Linux
/dev/sda3 21506048 37890047 8192000 83 Linux
/dev/sda4 37890048 81788927 21949440 5 Extended
/dev/sda5 37894144 54278143 8192000 83 Linux
/dev/sda6 54280192 58376191 2048000 83 Linux
/dev/sda7 58378240 62474239 2048000 82 Linux swap / Solaris
/dev/sda8 37892096 37894143 1024 83 Linux
/dev/sda9 62476288 66381823 1952768 82 Linux swap / Solaris
/dev/sdalO 66383872 66588671 102400 83 Linux
/dev/sdall 66590720 66795519 102400 83 Linux
/dev/sdal2 66797568 67002367 102400 83 Linux
/dev/sdal3 67004416 67209215 102400 83 Linux
/dev/sdal4 67211264 67416063 102400 83 Linux

Partition table entries are not in disk order

5. Create Meta disk by adding partitions or disks

Syntax:

[root@localhost~]# madam -C <meta_disk> -n <partition_l> <partition2> ... <partitition_n>

-l<raid_level>

-C (create metadisk)

-n (number of partition or disk)

-I (Raid level)

LINUX Lab Manual Page | 97 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

[root@localhost~]# mdadm -C /dev/mdO -n3 /dev/sdall /dev/sdal2 /dev/sdal3 -15

Result:

mdadm: Defaulting to version 1.2 metadata

mdadm: array /dev/mdO started

6. To see the detailed information of meta disk

Syntax:

[root@localhost~]# mdadm -D <meta_disk>

[root@localhost~]# mdadm -D /dev/mdO

/dev/mdO:
Version : 1.2
Creation Time : Wed Sep 2 01:30:30 2015
Raid Level: raid5
Array Size : 203776 (199.03 MiB 208.67 MB)
Used Dev Size : 101888 (99.52 MiB 104.33 MB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent

Update Time : Wed Sep 2 01:30:37 2015


State : clean
Active Devices : 3
Working Devices : 3
Failed Devices: 0
Spare Devices: 0

Layout: left-symmetric
Chunk Size :512K

Name : localhost.localdomain:0 (local to host localhost.localdomain)


UUID : daefal20:0538a29e:1741e5b5:e56c7017
Events : 18

Number Major Minor RaidDevice State


0 8 11 0 active sync /dev/sdall
1 8 12 1 active sync /dev/sdal2
3 8 13 2 active sync /dev/sdal3

LINUX Lab Manual Page | 98 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

7. Format the RAID meta disk

[root@localhost~]# mkfs.ext4 /dev/mdO

Result:

mke2fs 1.42.9 (28-Dec-2013)


Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=512 blocks, Stripe width=1024 blocks
51000 inodes, 203776 blocks
10188 blocks (5.00%) reserved for the super user
First data block=l
Maximum filesystem blocks=33816576
25 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done


Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

8. Add a folder to mount the meta disk

[root@localhost~]# mkdir/raid

9. Mount the meta disk on directory to use

Syntax:

[root@localhost~]# mount <meta_disk> <dir_name>

[root@localhost~]# mount /dev/mdO /raid

Verification:

[root@ local host"]# mount | grep /raid

/dev/mdO on /raid type ext4 (rw,relatime,seclabel,stripe=1024,data=ordered)

LINUX Lab Manual Page | 99 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

10. Enter into RAID mounted directory to add data

[root@localhost~]# cd /raid

[root@localhost raid]# Is

Result:

lost+found:

11. Write some content inside the RAID partition

[root@localhost raid]# cat > test

hello this is a test file of raid 5 on Linux_v7

ctrl+d (to save)

12. View the newly added file properties

[root@localhost raid]# Is -I

Result:

-rw-r-r- 1 root root 4 Aug 3115:02 test

13. To make the device faulty in RAID array

Syntax:

[root@localhost~]# mdadm <meta_disk> -f <partition_no.>

[root@localhost~]# mdadm /dev/mdO -f /dev/sdal2

mdadm: set /dev/sdal2 faulty in /dev/mdO

14. To see the detailed information of /dev/mdO and check the faulty device which is displayed
as spare.

[root@localhost~]# mdadm -D /dev/mdO

Verification:

/dev/mdO:
Version : 1.2
Creation Time : Fri Aug 14 01:59:05 2015
Raid Level: raid5
Array Size : 224256 (219.04 MiB 229.64 MB)
Used Dev Size : 112128 (109.52 MiB 114.82 MB)

LINUX Lab Manual Page | 100 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Raid Devices : 3
Total Devices: 3
Persistence : Superblock is persistent

Update Time : tue Sep 1 16:03:58 2015


State : clean, degraded
Active Devices: 2
Working Devices : 2
Failed Devices: 1
Spare Devices: 0

Layout: left-symmetric
Chunk Size : 512K

Name : clientl:0 (local to host client)


UUID : 96e0a496:a53aa9da:01e2b8f5:0a5bde05
Events : 20

Number Major Minor RaidDevice State


1 0 0 0 spare device /dev/sdal2
2 8 12 1 active sync /dev/sdall
3 8 13 2 active sync /dev/sdal3

15. To remove the faulty device

[root@localhostraid]# mdadm -r <meta_disk> <partition_no.>

[root@localhostraid# mdadm /dev/mdO -r /dev/sdal2

Result:

mdadm: hot removed /dev/sdal2

16. To view the status of meta disk

[root@localhostraid]# mdadm -D /dev/mdO

/dev/mdO:
Version : 1.2
Creation Time : tue Sep 1 16:13:45 2015
Raid Level: raid5
Array Size : 224256 (219.04 MiB 229.64 MB)
Used Dev Size : 112128 (109.52 MiB 114.82 MB)
Raid Devices : 3
Total Devices : 2

LINUX Lab Manual Page | 101 www.zoomgroup.com

0
Persistence : Superblock is persistent

Update Time : Fri Aug 14 02:03:58 2015


State : clean, degraded
Active Devices: 2
Working Devices : 2
Failed Devices: 0
Spare Devices: 0

Layout: left-symmetric
Chunk Size : 512K

Name : web.zoomgroup.com:0 (local to host web.zoomgroup.com)


UUID : 96e0a496:a53aa9da:01e2b8f5:0a5bde05
Events : 20

Number Major Minor RaidDevice State


0 0 0 0 removed
1 8 12 1 active sync /dev/sdall
3 8 13 2 active sync /dev/sdal3
[root@localhostraid_dir]# cd

17. To add new device into RAID

Syntax:

[root@localhost~]# mdadm -a <meta_disk> <partition_no.>

[root@localhost~]# mdadm -a /dev/mdO /dev/sdal4

Verification:

mdadm: added /dev/sdal4


[root@web ~]# mdadm -D /dev/mdO
/dev/mdO:
Version : 1.2
Creation Time : Fri Aug 14 01:59:05 2015
Raid Level: raid5
Array Size : 224256 (219.04 MiB 229.64 MB)
Used Dev Size : 112128 (109.52 MiB 114.82 MB)
Raid Devices: 3
Total Devices : 3
Persistence : Superblock is persistent

Update Time : Fri Aug 14 02:08:20 2015

LINUX Lab Manual Page | 102 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

State : clean, degraded, recovering


Active Devices: 2
Working Devices : 3
Failed Devices : 0
Spare Devices: 1
Layout: left-symmetric
Chunk Size : 512K
Rebuild Status : 40% complete
Name : web.zoomgroup.com:0 (local to host web.zoomgroup.com)
UUID : 96e0a496:a53aa9da:01e2b8f5:0a5bde05
Events : 42

Number Major Minor RaidDevice State


4 8 15 0 spare rebuilding /dev/sdal4
1 8 12 1 active sync /dev/sdal2
3 8 13 2 active sync /dev/sdal3

18. Unmount the meta device before you stop the RAID.

Syntax:

[root@localhost~]# umount <meta_disk>

[root@localhost~]# umount /dev/mdO

19. To stop the RAID

Syntax:

[root@localhost~]# mdadm -S <meta_disk>

[root@localhost~]# mdadm -S /dev/mdO

Result:

mdadm: stopped /dev/mdO

20. To activate or assemble the RAID meta device

Syntax:

[root@localhost~]# mdadm -A /dev/mdO <disk_l> <disk_2> <disk_3>

[root@localhost~]# mdadm -A /dev/mdO /dev/sdall /dev/sdal3 /dev/sdal4

Result:

mdadm: /dev/mdO has been started with 3 drives.

LINUX Lab Manual Page | 103 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

LAB 17: BACKUP AND RESTORE USING TAR AND FILTER THE ARCHIVE
THROUGH GZIP(-z)

OBJECTIVE:

To take Backup using tar and filter the archive through gzip

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

0
1. Create a folder along with some other directories and files

[root@localhost ~]# mkdir /myfolder

[root@localhost ~]# cd /myfolder/

[root@localhost myfolder]# mkdir dirl

[root@localhost myfolder]#touch 1 test_file tom_file

[root@localhost myfolder]# Is

dirl test_file tom_file

2. To take a backup and compress the file

Syntax:

[root@localhost ~]# tar <options> <file_name.tar.gz> <source_files/folders>

-c create

-v verbose

-f filename

-z compress the backup file

[root@localhost ~]# tar -cvzf myfolder.tar.gz /myfolder

Result:

tar: Removing leading '/' from member names


/myfolder/
/myfolder/dirl/
/myfolder/tom_file
/myfolder/test_file
/myfolder/1

Verification:

[root@localhost ~]# Is -Id myfolder.tar.gz

-rw-r--r--1 root root 251 Jul 13 03:09 myfolder.tar.gz

3. To view the contents of the backup file

Syntax:

[root@localhost ~]# tar <options> <file_name.tar.gz>

[root@ local host ~]# tar -tvzf myfolder.tar.gz

LINUX Lab Manual Page | 105 www.zoomgroup.com

0
Result:

drwxrwxrwx root/root 0 2008-07-13 01:31:34 myfolder/


drwxr-xr-x root/root 0 2008-07-13 01:28:39 myfolder/dirl/
-rw-r—r— tom/john 12 2008-07-13 01:29:51 myfolder/tom_file
-rw-rw-rw- root/root 0 2008-07-13 00:06:35 myfolder/test_file
-rw-r—r— tom/john 0 2008-07-13 01:31:34 myfolder/1

4. To test the backup, delete the source folder data

[root@localhost ~]# rm -r /myfolder

Result:

rm: descend into directory '/myfolder'? y


rm: remove directory '/myfolder/dirl1? y
rm: remove regular file '/myfolder/tom_file'? y
rm: remove regular empty file 7myfolder/test_file'? y
rm: remove regular empty file '/myfolder/11? y
rm: remove directory '/myfolder1? y

5. To restore the data

Syntax:

[root@localhost ~]# tar <options> <file_name.tar.gz> -C <new_dir>

[root@localhost ~]#tar-xvzf/root/myfolder.tar.gz -C /

Result:

myfolder/
myfolder/dirl/
myfolder/tom_file
myfolder/test_file
myfolder/1

Verification:

[root@localhost /]# Is /myfolder

Result:

1 dirl test file tom file

LINUX Lab Manual Page | 106 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 18: BACKUP AND RESTORE USING TAR AND FILTER THE ARCHIVE
THROUGH BZIP2(-j)

OBJECTIVE:

To take Backup using tar and filter the archive through bzip2

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

LINUX Lab Manual Page | 107 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To backup data

Syntax:

[root@localhost ~]# tar <options> <destination_file> <source_file.tar.bz2>

[root@ local host ~]#tar-cvjf /mnt/etc.tar.bz2 /etc

Result:

tar: Removing leading '/' from member names


/etc/
/etc/motd
/etc/os-release
/etc/sssd/
/etc/favicon, png
/etc/auto, master.d/
/etc/s m a rt m o n to o I s/
/etc/smartmontools/smartd_warning.d/

2. To check the backup data

Syntax:

[root@localhost ~]# tar -<options> <destination_file.tar.bz2> <source_dir>

[root@ local host ~]#tar-tvjf /mnt/etc.tar.bz2 /etc

Result:

drwxr-xr-x root/root 0 2015-09-01 12:51 etc/

-rw-r--r-- root/root 0 2013-06-07 20:01 etc/motd

-rw-r—r— root/root 254 2014-07-04 16:30 etc/os-release

drwx root/root 0 2014-06-17 23:12 etc/sssd/

3. To restore data if it is lost

Syntax:

[root@localhost~]#tar-xvjf <destination_file.bz2> -C <new_dir>

[root(5) local host ~]#tar-xvjf /mnt/etc.tar.bz2 -C /opt

Result:
etc/
etc/motd
etc/os-release

LINUX Lab Manual Page | 108 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

etc/sssd/
etc/favicon, png
etc/auto, master, d/
etc/smartmontools/
etc/smartmontools/smartd_warning.d/

4. Check the original data and backup file size

[root@ localhost ~]# du -sh /etc

Result:

31M /etc

[root@localhost~]# du -sh /mnt/etc.tar.bz2

Result:

6.7M /mnt/etc.tar.bz2

Note : Size difference between original and backup file.

LINUX Lab Manual Page | 109 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

LAB 19: BACKUP AND RESTORE USING CPIO COMMAND

OBJECTIVE:

To take Backup using cpio command

PRE-REQUISITE:

Machine with Linux Installed

TOPOLOGY:

0
ZOOM
.TECHNOLOGIES.

1. Enter into source directory from where you want the backup to be taken

[root@localhost~]# cd /myfolder

2. To take backup of filtered output

Syntax:

[root@localhost ~]# clist files/folders> | cpio-ov> <destination/backup_file.cpio>

-o out

-v verbose

-t table of content

-I in

[root@localhost myfolder ]# Is -d | cpio -ov > /mnt/zoom.cpio

Result:

1
dirl
myfolder.cpio
test_file
tom_file
1 block

3. To view content of backup file

Syntax:

[root@ local host ]# cpio -tf < <destination_file>

[root@localhost ]# cpio-tf < /mnt/zoom.cpio

Result:
1
dirl
test_file
tom_file
1 block

LINUX Lab Manual Page | 111 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

4. To test backup file by removing the original folder data

[root@localhost myfolder]# rm -r *

Verification:

rm: remove regular empty file '1'? y

rm: remove directory 'dirl'? y

rm: remove regular file 'myfolder.cpio1? n

rm: remove regular empty file vtest_file'? y

rm: remove regular file 'tom_file'? y

5. To restore data into present working directory.

[root@localhost myfolder]# cpio -iv < <destination_dir/file>

[root@localhost myfolder]# cpio -iv < /mnt/zoom.cpio

Verification:
1
dirl
test_file
tom_file
1 block

6. To check restored data

[root@localhost ~]# Is myfolder

Result:

1 dir test file tom file

0
ZOOM
TECH N OLOG IE!

LAB 20: NETWORK CONFIGURATION- IP ADDRESSING

OBJECTIVE:

To enable network communication between computers by assigning IP addresses.

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

System 1 System2

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 113 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. To set the hostname temporarily

Syntax:

[root@lcoalhost ~]# hostname <system_name>

[root@localhost ~]# hostname sysl.zoomgroup.com

2. To view the hostname

[root@localhost~]# hostname

sysl.zoomgroup.com

3. To set hostname permanently add in the following file

[root@sysl~]# vi /etc/hostname

sysl.zoomgroup.com

:wq!

4. To map ip and hostname locally add in following file

[root@sysl~]# vi /etc/hosts

127.0. 0.1 Localhost.localdomain localhost

192.168.0. 1 sysl.zoomgroup.com sysl

:wq!

Note: To update new configuration to kernel log out and log in to the operating system

5. Set ip address temporarily

Syntax:

[root@sysl~]# ifconfig <network_device_name> <IP address> netmask <netmask_value>

[root@sysl~]# Ifconfig enpls7 192.168.0.9 netmask 255.255.255.0

LINUX Lab Manual Page | 114 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

6. View the interface details.

[root@sysl~]# ifconfig

Result:

enpls7 Link encap:Ethernet HWaddr 00:13:20:B7:1D:44


inet addr:192.168.0.9 Bcast:192.168.0.255
Mask:255.255.255.0
inet6 addr: fe80::213:20ff:feb7:ld44/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:l
RX packets:48153 errors:4 dropped:0 overruns:0 frame:4
TX packets:21992 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39512670 (37.6 MiB) TX bytes:1720318 (1.6 MiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:l
RX packets:1249 errors:0 dropped:0 overruns:0 frame:0

7. To set permanent ip address

[root@sysl~]# nmtui

• Select Edit a connection


Application! Placot . rmlnal 4* 32 Mon 15 59 Q root

root@localhost.~

LINUX Lab Manual Page | 115 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

• Select device and Add option


»' Applications Ptacos U^rminal 4* Oi Mon 15:59 Q root

root£)localhost:~

File Edit View Search Terminal help

I rootfHocalhoit ‘ Picture* 1/4 Q

• Add Ethernet Device


»' Applications Placos r minal 4* Mon 15 59 P root

rootQlocalhost:M

File Edit View Search Terminal Help

LINUX Lab Manual Page | 116 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE

Select Static(Manual Method)


it Applications Places j^Qnninal * cl Sun 21:27 P root

root® server."

File Edit View Search Terminal Help

H Edit connection F

Profile name 3 tnernet connection 2


Device |

= ETHERNET <Show>

- IPv4 CONFIGURATIM BIMillflU <Show>


» IPv6 CONFIGURATION Automatic > <Shovr>

(X] Automatically connect


(X] Available to all users

<Cancel> <0K>

1,4
| mot pvr vrr “
a

ConfigurelPaddress, DNS server and gateway


s% Application Ptacos HfiT ■ 'minal + CS Mon 16:03 Q root

root<g)localhost:*

File Edit View Search Terminal Help

Profile name ithernet connection 1


Device

ETHERNET <Show>
I
IPv4 CONFIGURATION <Manual> <Hide>
Addresses 192.168.0.1/24 <Remove>
<Add...>
Gateway 192.168. 0.254 1
DNS servers <Add...>
Search domains <Add...>

Routing (No custom routes) <Edit...>


[ ] Never use this network for default route

[X] Require IPv4 addressing for this connection

1/4 Q,

LINUX Lab Manual Page | 117 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

• Select quit to proceed

8. Restart the service to activate the newly configured ip address


Syntax:

[root@sysl~]# <commad> <service_name> <action>

[root@sysl~]# service network restart

OR

[root@sysl~]# systemctl enable network

9. To view new ip address

[root@sysl~]# ifconfig

enpls7 Link encap:Ethernet HWaddr 00:13:20:B7:1D:44


inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::213:20ff:feb7:ld44/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:l
RX packets:48153 errors:4 dropped:0 overruns:0 frame:4
TX packets:21992 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39512670 (37.6 MiB) TX bytes:1720318 (1.6 MiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0

LINUX Lab Manual Page | 118 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

inet6 addr: ::1/128 Scope:Host


UP LOOPBACK RUNNING MTU:16436 Metric:

10. To Enable the NIC card


Syntax:

[root@sysl~]# ifup <network_device_name>

[root@sysl~]# ifup enpls7

Verification:

[root(5>sysl~]# Ifconfig

enpls7: flags=4163<U P, BROADCAST, RU NNING, M ULTICAST> mtu 1500


inet 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::20c:29ff:fe6a:f2a6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:6a:f2:a6 txqueuelen 1000 (Ethernet)
RX packets 25428 bytes 19635570 (18.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17895 bytes 4108956 (3.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

11. To Disable NIC card

Syntax:

[root@sysl~]# ifdown <network_device_name>

[root@sysl~]# ifdown enpls7

Verification:

[root@sysl~]# ifconfig

enpls7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500


ether 00:0c:29:6a:f2:a6 txqueuelen 1000 (Ethernet)
RX packets 25377 bytes 19628872 (18.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17711 bytes 4093938 (3.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

12. To Remove an ip address,remove the configuration file

[root@sysl~]# cd /etc/sysconfig/network-scripts/

LINUX Lab Manual Page | 119 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@syslnetwork-scripts]# Is

Result:

ifcfg-enpls7 ifdown-isdn ifup-ipsec ifup-routes


ifcfg-lo ifdown-ppp ifup-ipx ifup-sl
ifdown ifdown-sit ifup-isdn ifup-wireless
ifdown-aliases ifdown-sl ifup-plip init.ipv6-global
ifdown-ippp ifup ifup-plusb network-functions
ifdown-ipsec ifup-aliases ifup-post network-functions-ipv6
ifdown-ipv6 ifup-ippp ifup-ppp

[root@syslnetwork-scripts]# cat ifcfg- enpls7

Result:

DEVICE=enpls7
ONBOOT=yes
BOOTPROTO=static
I PADDR=192.168.0.1
NETMASK=255.255.255.0
GATEWAY=192.168.0.254

[root@syslnetwork-scripts]# rm -rf ifcfg- enpls7

Verification:

[root@syslnetwork-scripts]# Is
ifcfg-lo ifdown-ppp ifup-ipx ifup-sl
ifdown ifdown-sit ifup-isdn ifup-wireless
ifdown-aliases ifdown-sl ifup-plip init.ipv6-global
ifdown-ippp ifup ifup-plusb network-functions
ifdown-ipsec ifup-aliases ifup-post network-functions-ipv6
ifdown-ipv6 ifup-ippp ifup-ppp

Note: ifcfg-enpls7 file is removed

13. To update ip changes start/restart the services

[root@syslnetwork-scripts]# service network restart

#### OR #####

[root@syslnetwork-scripts]# systemctl enable network

LINUX Lab Manual Page | 120 www.zoomgroup.com

0
LAB 21: PACKAGE MANAGEMENT (RPM COMMAND)

OBJECTIVE:

To install packages using RPM command

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System 2

RPM or YUM Server Client System

IP Address 192.168.0.250 IP Address 192.168.0.X

LINUX Lab Manual Page | 121 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

To install packages from dvd

1. To query whether package is installed or not

Syntax:

[root@client ~]# rpm -q <package_name>

[root@client ~]# rpm -q zip

Result:

zip-3.0-10.el7.x86_64

2. To remove the installed package

Syntax:

[root@client ~]# rpm -e <package_name>

[root@client ~]# rpm -e zip - - nodeps

[root@client ~]# rpm -q zip

Result:

Package zip is not installed

3. Insert dvd and mount it on dir

[root@client ~]# mount /dev/srO /media

mount: /dev/srO is write-protected, mounting read-only

4. To verify mount point of dvd

[root@client ~]# mount

Verification:

/dev/sda5 on / type ext4 (rw,relatime,seclabel,data=ordered)


/dev/sda2 on /usr type ext4 (rw,relatime,seclabel,data=ordered)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs
/dev/sda9 on /disk9 type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sdal on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda6 on /home type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda3 on /var type ext4 (rw,relatime,seclabel,data=ordered)
/dev/srO on /media type iso9660
(ro,relatime,uid=0,gid=0,iocharset=utf8,mode=0400,dmode=0500)

LINUX Lab Manual Page | 122 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. Go to dvd mount point to install packages.

[root@client ]# cd/media/Packages

[root@client ]# Is

Result:

Displays the list of all packages with extension .rpm

6. To install, to view verbose output, and to check the progress of installation of packages with

hash sign.

Syntax:

[root@client ]# rpm <option> <package_name.rpm>

-i install

-v verbose

-h to see the installation progress with hash

--force to install package forcefully if it is already installed

[root@client ]# rpm -ivh zip*.rpm

Verification:

Warning: zip-3.0-10.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5:

NOKEY

Preparing... ################################# [ioo%]


Updating / installing...

1: zip-3.0-10.el7 ################################# [100%]

LINUX Lab Manual Page | 123 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

To install packages from server by using 'NFS' service

1. To query package is installed or not

[root@client ~]# rpm -q vsftpd

Verification:

vsftpd-3.0-10.el7.x86_64

2. If package is installed remove it

[root@client ~]# rpm -e vsftpd

3. Mount a share folder of NFS share folder in linux client system

[root@client ~]# mount 192.168.0.250:/var/ftp/pub/centos7/Packages /mnt

[root@client ~]# mount

Verification:

/dev/sda5 on / type ext4 (rw,relatime,seclabel,data=ordered)


/dev/sda2 on /usr type ext4 (rw,relatime,seclabel,data=ordered)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs
192.168.0.250:/var/ftp/pub/centos7/Packages on /mnt type nfs
(rw,relatime,seclabel/data=ordered)
/dev/sdal on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda6 on /home type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda3 on /vartype ext4 (rw,relatime,seclabel,data=ordered)

[root@client ~]# cd /mnt

[root@client ~]# Is

Verification;

Displays the list of all packages with rpm extension.

LINUX Lab Manual Page | 124 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

4. To install packages forcefully if package is already installed

Syntax:

[root@client mnt]# rpm -ivh <package_name> --force

[root@client mnt]# rpm -ivh vsftpd*.rpm --force

Result:

Warning: vsftpd-3.0-10.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5:


NOKEY
Preparing... ################################# [ioo%]
Updating / installing...
1: vsftpd-3.0-10.el7 ################################# [100%]

To query the packages with some more options of rpm

1. To query all installed packages whose name starts with word samba

Syntax;

[root@client mnt]# rpm -qa <package_name>

[root@client mnt]# rpm -qa samba*

Verification:

samba-client-4.1.1-31. el7.x86_64
samba-libs-4.1.1-31.el7.x86_64
samba-4.1.1-31.el7.x86_64
samba-common-4.1.1-31.el7.x86_64

2. To query the information of any package

Syntax:
[root@client mnt]# rpm -qi <package_name>

[root@client mnt]# rpm -qi samba

Result:

Name : samba
Epoch :0
Version : 4.1.1
Release : 31.el7
Architecture: x86_64
Install Date: Mon 31 Aug 2015 01:39:38 AM 1ST
Group : System Environment/Daemons
Size : 1616509

LINUX Lab Manual Page | 125 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

License : GPLv3+ and LGPLv3+


Signature : RSA/SHA256, Fri 04 Jul 2014 10:23:17 AM 1ST, Key ID 24c6a8a7f4a80eb5
Source RPM : samba-4.1.1-31.el7.src.rpm
Build Date : Tue 17 Jun 2014 11:20:16 PM 1ST
Build Host : workerl.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor :CentOS
URL : http://www.samba.org/
Summary : Server and Client software to interoperate with Windows machines
Description :
Samba is the standard Windows interoperability suite of programs for Linux and Unix.

3. To query the list of all files of particular package

Syntax:

[root@client mnt]# rpm -ql <package_name>

[root@client mnt]# rpm -ql samba

Result:

/etc/openldap/schema
/etc/openldap/schema/samba. schema
/usr/bin/eventlogadm
/usr/bin/smbstatus

/usr/share/man/man8/vfs_tsmsm.8.gz
/usr/share/man/man8/vfs_xattr_tdb.8.gz
/var/spool/samba

4. To query package related documentation and man pages

Syntax:

[root@client mnt]# rpm -qd <package_name>

[root@client mnt]# rpm -qd samba

Result:

/usr/share/doc/samba-4.1.1/COPYING
/usr/share/doc/samba-4.1.1/LDAP/README
/usr/share/doc/samba-4.l.l/LDAP/get_next_oid
/usr/share/doc/samba-4.1.1/LDAP/ol-schema-migrate.pi

LINUX Lab Manual Page | 126 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. To query package configuration files

Syntax:

[root@client mnt]# rpm -qc <package_name

[root@localhost ~]# rpm -qc samba-common

Result:

/etc/logrotate.d/samba
/etc/sa m ba/l m hosts
/etc/samba/smb.conf
/etc/sysconfig/samba

LINUX Lab Manual Page | 127 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

LAB 22: PACKAGE MANAGEMENT (YUM COMMAND)

OBJECTIVE:

To install packages using YUM command

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System2

RPM or YUM Server Client System

IP Address 192.168.0.250 IP Address 192.168.0.X

Note: In Labs 'YUM' Server has been already configured.

At client side edit the yum configuration file by providing the server ip-address and

package directory path as follow.

LINUX Lab Manual Page | 128 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

1. Provide the YUM server IP address and package directory name in yum file

[root@client ~]# vi /etc/yum. repos.d/CentOS-Base.repo

[core]

name= Linux $releasever - $basearch - Debug

baseurl=ftp://192.168.0.250/pub/centos7/Packages

enabled=l

gpgcheck=l

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2. To see the list of packages available in repository i.e on yum server

Syntax:

[root@client ~]# yum list <package_name>

[root@client ~]# yum list samba*

Verification:

Loaded plugins: fastestmirror, refresh-package kit, security


Loading mirror speeds from cached hostile
core | 1.2 kB 00:00
Installed Packages
samba.x86_64 3.5.10-125.el6 @core
samba-client.x86_64 3.5.10-125.el6 @core
samba-common.x86_64 3.5.10- 125.el6 @core
samba-doc.x86_64 3.5.10- 125. el6 @core
samba-domainjoin_64 3.5.10- 125.el6 @core
samba-swat.x86_64 3.5.10-125.el6 @core
samba-winbind.x86_64 3.5.10-125.el6 @core
samba4-pidl.x86_64 4.0.0-23.alphall.el6 @core
Available Packages
samba-common.i686 3.5.10-125.el6 core
samba-winbind-clients.i686 3.5.10-125.el6 core
samba-winbind-devel.i686 3.5.10-125.el6 core

LINUX Lab Manual Page | 129 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

3. To install packages

Syntax:

[root@ client ~]# yum install <package_name> -y

[root@ client ~]# yum install samba* -y

Loaded plugins: fastest mirror, refresh-package kit, security


Setting up Install Process
Package samba-winbind-krb5-locator-3.5.10-125.el6.x86_64 already
Package samba-winbind-3.5.10-125.el6.x86_64 already installed and latest version
Package samba-winbind-clients-3.5.10-125.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
—> Package samba.x86_64 0:3.5.10-125.el6 will be installed
Dependency Installed:
xinetd.x86_64 2:2.3.14-34.el6 Complete!

4. To see the list of installed packages in the local system

[root@client ~]# yum list installed samba*

Verification:

Loaded plugins: fastestmirror, refresh-packagekit, security


Loading mirror speeds from cached hostfile
Installed Packages
samba.x86_64 3.5.10-125.el6
samba-client.x86_64 3.5.10-125.el6
samba-common.x86_64 3.5.10-125.el6
samba-doc.x86_64 3.5.10-125.el6
samba-domainjoin-gui.x86_64 3.5.10-125.el6
samba-swat.x86_64 3.5.10-125.el6
samba-winbind.x86_64 3.5.10-125.el6
samba-winbind-clients.x86_64 3.5.10-125.el6
samba-winbind-devel.x86_64 3.5.10-125.el6
samba-winbind-krb5-locator.x86 3.5.10-125.el6

LINUX Lab Manual Page | 130 www.zoomgroup.com

0
LAB 23: DHCP SERVER

OBJECTIVE:

To provide Dynamic IP address to clients with a DHCP server

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System 2

DHCP Server DHCP Client

IP Address 192.168.0.X No ip configured in client

LINUX Lab Manual Page | 131 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

DHCP Server Configuration

1. Check whether the packages are installed or not

[root@dhcp ~]# rpm -qa dhcp-*

Result:

dhcp-libs-4.2.5-27.el7.centos.x86_64
dhcp-common-4.2.5-27.el7.centos.x86_64
dhcp-4.2.5-27.el7.centos.x86_64

2. If packages are installed, remove them

[root@dhcp ~]# rpm -e dhcp-libs dhcp-common dhcp --nodeps

Note : While removing only give the name of packages, don't use yum otherwise

dependencies will be also get removed.

3. To Install the packages

[root@dhcp ~]# yum install dhcp-* -y

Result:

Loaded plugins: fastestmirror, langpacks


Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
—> Package dhcp.x86_64 12:4.2.5-27.el7.centos will be installed
—> Package dhcp-common.x86_64 12:4.2.5-27.el7.centos will be installed
—> Package dhcp-libs.x86_64 12:4.2.5-27.el7.centos will be installed
--> Finished Dependency Resolution

Install 3 Packages
Total download size: 801 k
Installed size: 1.8 M
Downloading packages:

Total 88 MB/s | 801


kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.

0
ZOOM
.TECHNOLOGIES.

Installed:
dhcp.x86_64 12:4.2.5-27.el7.centos dhcp-common.x86_64 12:4.2.5-27. el7. centos
dhcp-libs.x86_64 12:4.2.5-27.el7.centos

Complete!

4. Copy the sample dhcp configuration file

[root@dhcp ~]# cp -rv /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example


/etc/dhcp/dhcpd.conf

5. Edit the Main Configuration File

[root@dhcp ~]# vi /etc/dhcp/dhcpd.conf

Verification:

# A slightly different configuration for an internal subnet,


subnet 192.168.0.0 netmask 255.255.255.0 { ## Network ID
range 192.168.0.1 192.168.0.200; ## pool of IP address
option domain-name-servers 192.168.0.253; ## DNS IP
option domain-name "zoomgroup.com"; ## DNS Name
option routers 192.168.0.254; ## Gateway or Router IP
default-lease-time 600;
max-lease-time 7200;

Host fantasia { ## fixed ip-address or DHCP


Hardware ethernet 08:00:07:26:c0:a5; ## reservation or
Fixed-address 192.168.0.200; ## mac binding
}

6. Start the services

[root@dhcp ~]# service dhcpd restart

Result:

Redirecting to /bin/systemctl restart dhcpd.service

#### OR ####

[root@dhcp ~]# systemctl enable dhcpd

Result:

In -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-
user.target.wants/dhcpd.service'

LINUX Lab Manual Page | 133 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

DHCP Client Configuration

1. Select DHCP in nmtui command

[root@client ~]# nmtui

Select

Edit a connection => Ethernet name => IPv4 CONFIGURATION <Automatic>

2. To view DORA PROCESS and also get Dynamic IP-Address

[root@client ~]# dhclient -v

Verification:

Internet Systems Consortium DHCP Client 4.2.5


Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/enpls7/00:0c:29:df:d3:51
Sending on LPF/enpls7/00:0c:29:df:d3:51
Sending on Socket/fallback
DHCPDISCOVER on enpls7 to 255.255.255.255 port 67 interval 5 (xid=0x4d83e522)
DHCPREQUEST on enpls7 to 255.255.255.255 port 67 (xid=0x4d83e522)
DHCPOFFER from 192.168.0.252
DHCPACK from 192.168.0.252 (xid=0x4d83e522)
bound to 192.168.0.200 — renewal in 742 seconds.

3. Start the service

[root@client ~]# service network restart

#### OR ####

[root@client ~]# systemctl enable network

4. To verify IP-Address

[root@client ~]# ifconfig

Verification:
enpls7 Link encap:Ethernet HWaddr 00:13:20:B7:1D:44
inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::213:20ff:feb7:ld44/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:!

LINUX Lab Manual Page | 134 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

RX packets:48153 errors:4 dropped:0 overruns:0 frame:4


TX packets:21992 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39512670 (37.6 MiB) TX bytes:1720318 (1.6 MiB)

5. To check gateway or router ip

[root@client ~]# route -nv

Verification:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.254 0.0.0.0 UG 1024 0 0 enpls7
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 enpls7

6. To check DNS IP

[root@client ~]# cat /etc/resolv.conf

Verification:

# Generated by NetworkManager
search zoomgroup.com
nameserver 192.168.0.253

LINUX Lab Manual Page | 135 www.zoomgroup.com

0
LAB 24 : FTP SERVER

OBJECTIVE:

To configure FTP server to act as a central repository of files which can be accessed by legitimate

clients.

To download and upload files to an FTP server.

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

System 1 System2

FTP Server FTP Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 136 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

FTP Server Configuration for downloading files

1. Check whether the FTP package exists,

and install the application

[root@ftpserver ~]# rpm -q vsftpd

Verification:

vsftpd-3.0.2-9.el7.x86_64

If it exists,remove the package

[root@ftpserver ~]# rpm -e vsftpd

Do a fresh install of the FTP pacakage

[root@ftpserver ~]# yum install vsftpd* -y

Verification:

Running transaction
Warning: RPMDB altered outside of yum.
Installing : vsftpd-3.0.2-9.el7.x86_64 1/1
Verifying : vsftpd-3.0.2-9.el7.x86_64 1/1
Installed:
vsftpd.x86_64 0:3.0.2-9.el7

2. Add some files to the ftp default directory

[root@ftpserver ~]# cd /var/ftp/pub

[root@ftpserver pub]# touch zoom.txt linux.txt music.mp3

Verification:

[root@ftpserver pub]# Is

linux.txt music.mp3 zoom.txt

3. Start the service

[root@ftpserver ~]# service vsftpd restart

Redirecting to/bin/systemctl restart vsftpd.service

##### OR #####

LINUX Lab Manual Page | 137 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@ftpserver ~]# systemctl enable vsftpd

FTP Client Configuration for downloading files

1. Connect to ftp server to download files

[root@ftpclient ~]# ftp 192.168.0.X

Name (192.168.0.X:root): ftp

331 Please specify the password.

Password: enter key

230 Login successful.

ftp> Is

drwxr-xr-x 30 0 4096 aug 19 20:44 pub

ftp> cd pub

ftp> Is

-rw-r--r-- 10 0 0 Jul 11 20:42 zoom.txt


-rw-r-r- 10 0 0 Jul 11 20:42 linux.txt
-rw-r-r- 10 0 0 Jul 11 20:42 music.mp3
ftp>mget zoom.txt* linux.txt*

ftp>bye

2 . To check downloaded files, move to client home directory

[root @ftpclient ~]# Is /root

Result:

Anaconda.cfg install.log install.log.syslog Desktop zoom.txt linux.txt

LINUX Lab Manual Page | 138 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

FTP Server Configuration for uploading files

1. Add new directory in ftp default directory

[root@ftpserver ~]# mkdir /var/ftp/upload

2. Give full permissions on new dir

[root@ftpserver ~]# chmod 777 /var/ftp/upload

Verification:

[root@ftpserver ~]# Is -Id /var/ftp/upload

drwxr-xr-x 2 root root 4096 Aug 31 08:30 /var/ftp/upload

3. Edit the ftp directory as follows...

[root@ftpserver ~]# vi /etc/vsftpd/vsftpd.conf

12 anonymous_enable=YES
16 local_enable=YES
29 anon_upload_enable=YES
37 dirmessage_enable=YES
86 ftpd_banner=Welcome to Zoom Linux.

:wq!

4. Restart the ftp service

[root@ftpserver ~]# service vsftpd restart

#### OR ####

[root@ftpserver ~]# systemctl enable vsftpd

LINUX Lab Manual Page | 139 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

FTP Client Configuration for uploading files

1. Connect ftp server from client system

[root@ftpclient ~]# ftp 192.168.0.X

Name (192.168.0.X:root): ftp


331 Please specify the password.
Password: enter key
230 Login successful.
ftp>ls
drwxr-xr-x 30 0 4096 aug 19 20:44 pub
drwxrwxrwx 20 0 4096 aug 19 21:05 zoomupload
ftp>pwd
ftp>cd..
ftp>cd zoomupload
ftp>pwd (to check present working directory)
ftp>mput initial-setup-ks.cfg
ftp>bye

Note: To check client uploaded files, move to ftp server and check in ftp

Verification:

[root@ftpserver ~]# Is /var/ftp/zoomupload

Verification:

initial-setup-ks.cfg

LINUX Lab Manual Page | 140 www.zoomgroup.com

0
LAB 25: YUM SERVER

OBJECTIVE:

To configure YUM Deployment Server and client

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System 2

YUM Server YUM Client

IP Address 192.168.0.X IP Addressl92.168.0.X

LINUX Lab Manual Page | 141 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

YUM Server Configuration

1. Install ftp application by using the Linux OS dvd

[root@YumServer ~]# mount /dev/srO /media

[root@YumServer ~]# cd /media/Packages

Verification:

[root@YumServer ~]# Is

389-ds-base-libs-1.3.1.6-25.el7.x86_64.rpm
a2ps-4.14-23.el7.i686.rpm
a2ps-4.14-23.el7.x86_64.rpm
abattis-cantarell-fonts-O.0.12-3. el7. noarch, rpm
abrt-2.1.11-12. el7.centos.x86_64.rpm

[root@YumServer ~]# rpm -ivh vsftpd* --force

Result:

Preparing... ################################# [100%]


Updating / installing...
l:vsftpd-3.0.2-9.el7 ################################# [ 50%]
2:vsftpd-sysvinit-3.0.2-9.el7 #################################[ 100%]

2. Copy DVD's complete data into ftp dir

[root@YumServer ~]# cp -rv /media/* /var/ftp/pub

Result:

7media/CentOS_BuildTag/ -> 7var/ftp/pub/CentOS_BuildTag/


7media/EFI' -> 7var/ftp/pub/EFI'
7media/EFI/BOOr -> 7var/ftp/pub/EFI/BOOT'
7media/EFI/BOOT/BOOTX64.efi' -> 7var/ftp/pub/EFI/BOOT/BOOTX64.efi'
7media/EFI/BOOT/fonts' -> 7var/ftp/pub/EFI/BOOT/fonts'
7media/EFI/BOOT/fonts/TRANS.TBL'-> 7var/ftp/pub/EFI/BOOT/fonts/TRANS.TBL'
7media/EFI/BOOT/fonts/unicode.pf2' -> 7var/ftp/pub/EFI/BOOT/fonts/unicode.pf2'

LINUX Lab Manual Page | 142 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

3. Create a repository at side where all rpms are copied

[root@YumServer ~]# cd /var/ftp/pub/Packages

[root@YumServer ~]# rpm -ivh createrepo* deltarpm* --force -nodeps

4. Remove the old repodata directory from where all rpms copied

[root@YumServer ~]# cd /var/ftp/pub

[root@YumServer ~]# rm -rf repodata

5. Create a new repodata (Repositories)

[root@YumServer ~]# createrepo -g <dvd_mount_point>/<repodata_dir>/<file>

[root@YumServer ~]# createrepo -g /media/Packages/repodata/repomd.xml


/var/ftp/pub/Packages

6. Start FTP Service

[root@YumServer ~]# service vsftpd restart

##### OR #####

[root@YumServer ~]# systemctl enable vsftpd

7. Edit the yum configuration file, by providing the path of repository and IP-address

[root@YumClient ~]# vi /etc/yum. repos.d/CentOS-Base.repo

Verification:

[core]
name= Linux $releasever - $basearch - Debug
baseurl=ftp://192.168.0.250/pub/Packages
enabled=l
gpgcheck=l
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

:wq!

LINUX Lab Manual Page | 143 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

YUM Client Configuration

1. Edit the yum configuration file, by providing the path of repository and server ip-address

[root@YumClient ~]# vi /etc/yum. repos.d/CentOS-Base.repo

[core]
name= Linux $releasever - $basearch - Debug
baseurl=ftp://192.168.0.250/pub/Packages
enabled=l
gpgcheck=l
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
:wq!

Verification:

[root@YumServer ~]# yum install firefox* -y

Loaded plugins: fastestmirror, langpacks


base | 3.6 kB 00:00:00
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
—> Package firefox.x86_64 0:24.5.0-1.el7.centos will be installed
--> Finished Dependency Resolution
Installing : firefox-24.5.0-1.el7.centos.x86_64 1/1

Verifying : firefox-24.5.0-1.el7.centos.x86_64 1/1

Installed:
firefox.x86_64 0:24.5.0-1.el7.centos

Complete!

LINUX Lab Manual Page | 144 www.zoomgroup.com

0
LAB 26: NFS SERVER

OBJECTIVE:

To share Network resources with an NFS server

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

5
\
Switch

System 1 System 2

NFS Server NFS Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 145 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

NFS Server Configuration

1. Install NFS application

[root@nfsserver ~]# yum install nfs* -y

[root@nfsserver ~]# rpm -qa nfs*

Verification:

nfs-utils-1.3.0-0.el7.x86_64
nfsometer-1.7-0.el7.noarch
nfs4-acl-tools-0.3.3-13.el7.x86_64
nfstest-1.0.2-2. el7. noarch

2. Add a directory to share

[root@nfsserver ~]# mkdir /zoomshare

[root@nfsserver ~]# cat > /zoomshare/"Advanced Linux"

The zoomshare directory contains the names of Advanced Linux course topics

CLUSTERS, SAN, LDAP, SAMBA, NAGIOS, PROXY and TROUBLESHOOTING etc.

Ctrl+d (to save file data)

3. List the share directory data

[root@nfsserver ~]# Is /zoomshare

4. Give full permissions on share directory

[root@nfsserver ~]# chmod 777 /zoomshare

Verification:

[root@nfsserver ~]# Is -Id /zoomshare

drwxrwxrwx 2 root root 4096 Aug 3112:57 /zoomshare

LINUX Lab Manual Page | 146 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. Provide share directory name in NFS configuration file and and give share permissions.

[root@nfsserver ~]# vi /etc/exports

/zoomshare 192.168.0.0/255.255.255.0(rw,sync)

:wq!

6. Start the nfs service

[root@nfsserver ~]# service nfs restart

#### OR #####

[root@nfsserver ~]# systemctl enable nfs

7. Verifythe list of exported directories where 192.168.0.X is the NFS server IP Address

[root@nfsserver ~]# showmount -e 192.168.0.X

Result:

Export list for 192.168.0.X :

/zoomshare 192.168.0.0/255.255.255.0

NFS Client Configuration

1. Verify the exported directory of server

[root@nfsclient ~]# showmount -e 192.168.0.X

Result:

Export list for 192.168.0.X :

/zoomshare 192.168.0.0/255.255.255.0

2. Mountthe shared directory

[root@nfsclient ~]# mount 192.168.0.X:/zoomshare /mnt

3. Find the mount point of nfs server

[root@nfsclient ~]# mount

LINUX Lab Manual Page | 147 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Verification:

/dev/sda5 on / type ext4 (rw,relatime,seclabel,data=ordered)


/dev/sda2 on /usr type ext4 (rw,relatime,seclabe!,data=ordered)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs
192.168.0.250:/var/ftp/pub/centos7 on /mnttype nfs (rw,relatime,seclabel,data=ordered)
/dev/sdal on /boot type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda6 on /home type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda3 on /vartype ext4 (rw,relatime,seclabel,data=ordered)

4. Check the server data

[root@nfsclient ~]# cd /mnt/zoomshare

[root@nfsclient zoomshare ]# cat "Advanced Linux"

Verification: NFS share directory data can be shown

The zoomshare directory contains the names of Advanced Linux course topics

CLUSTERS, SAN, LDAP, SAMBA, NAGIOS, PROXY and TROUBLESHOOTING etc.

LINUX Lab Manual Page | 148 www.zoomgroup.com

0
LAB 27: DNS SERVER

OBJECTIVE:

To provide name resolution in a network with a DNS server

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

System 1 System 2

DNS Server DNS Linux Client

IP Address 192.168.0.X IP Address 192.162.0.X

LINUX Lab Manual Page | 149 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

DNS Server Configuration

1. Check and assign IP address to the DNS server according to your setup

[root@dns ~]# nmtui

Profile name enpls7

Addresses 192.168.0.1/24

DNS servers 192.168.0.X

[root@dns ~]# service network restart

[root@dns ~]# ifconfig

Verification:

Enpls7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500


inet 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::20c:29ff:fe6a:f2a6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:6a:f2:a6 txqueuelen 1000 (Ethernet)
RX packets 379 bytes 44431 (43.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 296 bytes 50119 (48.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

2. Change Hostname of computer

[root@dns ~]# hostname dns.zoomgroup.com

3. Map Hostname and IP for local resolution

[root@dns ~]# vi /etc/hosts

127.0.0.1 localhost.localdomain localhost


192.168.0.1 dns.zoomgroup.com dns
:wq!

4. Change Hostname permanent

[root@dns ~]# vi /etc/hostname

dns.zoomgroup.com

LINUX Lab Manual Page | 150 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. NOW LOG OFF and LOG IN to make the changes permanent in the kernel

6. Check the dns applications

[root@dns ~]# rpm -qa bind*

Verification:

bind-libs-lite-9.9.4-14.el7.x86_64
bind-chroot-9.9.4-14.el7.x86_64
bind-utils-9.9.4-14.el7.x86_64
bind-dyndb-ldap-3.5-4.el7.x86_64
bind-libs-9.9.4-14.el7.x86_64
bind-9.9.4-14.el7.x86_64
bind-license-9.9.4-14.el7.noarch

7. Remove the dns applications

[root@dns ~]# yum remove bind* -y

8. Install the dns applications

[root@dns ~]# yum install bind* -y

9. Edit DNS file and provide the IP address it listens on

[root@dns ~]# vi /etc/named.conf

11: listen-on port 53 {127.0.0.1; 192.168.0.1;};

17: allow-query {localhost; 192.168.0.0/24;};

:wq!

LINUX Lab Manual Page | 151 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

10. Edit DNS file by providing zone file names

[root@dns ~]# vi /etc/named.rfcl912.zones

zone "zoomgroup.com" IN {
type master;
file "zoom.for";
allow-update {none;};
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "zoom.rev";
allow-update {none;};
};

:wq!

11. Create Forward Zone and Reverse Zone files

[root@dns ~]# cd /var/named

Verification:

[root@dns named]# Is

chroot data dynamic named.ca named.empty named.localhost named.loopback slaves

[root@dns named]# cp -p named.localhost zoom.for

[root@dns named]# cp -p named.loopback zoom.rev

Verification:

[root@dns named]# II

total 40
drwxr-x— 7 root named 4096 Sep 1 06:54 chroot
drwxrwx— 2 named named 4096 Sep 1 07:04 data
drwxrwx— 2 named named 4096 Sep 1 07:04 dynamic
-rw-r 1 root named 2076 Jan 28 2013 named.ca
-rw-r 1 root named 152 Dec 15 2009 named.empty
-rw-r 1 root named 152Jun 21 2007 named.localhost
-rw-r 1 root named 168 Dec 15 2009 named.loopback

LINUX Lab Manual Page | 152 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

drwxrwx— 2 named named 4096 Jun 10 2014 slaves


-rw-r 1 root named 152 Jun 21 2007 zoom.for
-rw-r 1 root named 168 Dec 15 2009 zoom.rev

12. Edit Forward zone file

[root@dns named]# vi zoom.for

$TTL 86400
@ IN SOA dns.zoomgroup.com. root.zoomgroup.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
ID) ; minimum

IN NS dns.zoomgroup.com.
dns IN A 192.168.0.1
nfs IN A 192.168.0.10
ftp IN A 192.168.0.11
smb IN A 192.168.0.12
mail IN A 192.168.0.13
zoomgroup.com. IN MX 5 mail
web IN A 192.168.0.14
www IN CNAME web

:wq!

13. Edit reverse zone file

[root@dns named]# vi zoom.rev

$TTL 86400
@ IN SOA dns.zoomgroup.com. root.zoomgroup.com. (
1997022700; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum

IN NS dns.zoomgroup.com.
IN NS slavedns.zoomgroup.com.

LINUX Lab Manual Page | 153 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

1 IN PTR dns.zoomgroup.com.
10 IN PTR nfs.zoom.com.
11 IN PTR ftp.zoom.com.
12 IN PTR smb.zoom.com.
13 IN PTR mail.zoomgroup.com.
14 IN PTR web.zoom.com.

:wq!

14. To Check the Syntax errors of Configuration file

Syntax:

[root@localhost ~]# named-checkconf <path_of_configuration_file>

[root@localhost ~]# named-checkconf/etc/named.conf

[root@localhost ~]# named-checkconf/etc/named.rfcl912.zones

Verification:

If no errors then no output will be displayed.

15. To Check the Zone file syntax errors

Syntax:

[root@ local host ~]# named-checkconf <Domain_name> <path_of_zone_files>

[root@localhost ~]# named-checkzone zoomgroup.com /var/named/zoom.for

[root@localhost ~]# named-checkzone zoomgroup.com /var/named/zoom.rev

16. Provide the IP address of the DNS Server

[root@dns named]# vi /etc/resolv.conf

nameserver 192.168.0.1

:wq!

0
ZOOM
TECH NOLOGIES

17. Start the DNS service

[root@dns named]# service named restart

Redirecting to /bin/systemctl restart named.service

##### OR ######

[root@dns named]# systemctl enable named

DNS Client Configuration

1. Provide the DNS server ip in resolv.conf file

[root@dns named]# vi /etc/resolv.conf

nameserver 192.168.0.1

:wq!

2. Check the forward lookup zone Resolution Answer by using dig command

Syntax::

[root@dns named]# dig <Fully _qualified_domain _name>

[root@dns named]# dig dns.zoomgroup.com

Result:

; «» DiG 9.9.4-RedHat-9.9.4-14.el7 «» dns.zoomgroup.com


;; global options: +cmd
;; Got answer:
;; -»HEADER«- opcode: QUERY, status: NOERROR, id: 21811
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;dns.zoomgroup.com. IN A

;; ANSWER SECTION:
dns.zoomgroup.com. 86400 IN A 192.168.0.1

;; AUTHORITY SECTION:
zoomgroup.com. 86400 IN NS dns.zoomgroup.com.

LINUX Lab Manual Page | 155 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

;; Query time: 1 msec


;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Sep 01 07:32:23 1ST 2015
;; MSG SIZE rcvd: 76

3. Check the reverse lookup zone Resolution Answer by using dig command

Verification:

[root@dns named]# dig -x <self_system_ip>

[root@dns named]# dig -x 192.168.0.1

Result:

; «» DiG 9.9.4-Red Hat-9.9.4-14.el7 «» -x 192.168.0.1


;; global options: +cmd
;; Got answer:
;; -»HEADER«- opcode: QUERY, status: NOERROR, id: 53498
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;1.0.168.192.in-addr.arpa. IN PTR

"ANSWER SECTION:
1.0.168.192.in-addr.arpa. 86400 IN PTR dns.zoomgroup.com.

;; AUTHORITY SECTION:
0.168.192.in-addr.arpa. 86400 IN NS 0.168.192.in-addr.arpa.

;; ADDITIONAL SECTION:
0.168.192.in-addr.arpa. 86400 IN A 192.168.0.1

;; Query time: 0 msec


;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Sep 01 07:36:13 1ST 2015
;; MSG SIZE rcvd: 114

LINUX Lab Manual Page | 156 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

4. Check the Resolution Answer by using ping command

Verification:

[root@server ~]# ping dns.zoomgroup.com

PING dns.zoomgroup.com (192.168.0.110) 56(84) bytes of data.

64 bytes from server.zoomgroup.com (192.168.0.1): icmp_seq=l ttl=64

64 bytes from server.zoomgroup.com (192.168.0.1): icmp_seq=2 ttl=64

64 bytes from server.zoomgroup.com (192.168.0.1): icmp_seq=3 ttl=64

LINUX Lab Manual Page | 157 www.zoomgroup.com

0
LAB 28: POSTFIX MAIL SERVER

OBJECTIVE:

To configure Postfix mail server to send and receive mails

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System2

MAIL Server MAIL Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 158 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

Mail Server Configuration

1. Check the ip-address on the server chosen as mail server

[root@client ~]# ifconfig

2. Assign the IP address for mail server

[root@client ~]# nmtui

Profile name enpls7

Addresses 192.168.0.20/24

DNS servers 192.168.0.1

[root@client ~]# service network restart

3. Change Hostname permanently

[root@client ~]# hostname mail.zoomgroup.com

[root@client ~]# vi /etc/hostname

mail.zoomgroup.com

:wq!

4. Map Hostname and IP for local resolution

[root@client ~]# vi /etc/hosts

127.0. 0.1 localhost.localdomain localhost

192.168.0. 20 mail.zoomgroup.com mail

:wq!

Verification:

[root@client ~]# hostname

mail.zoomgroup.com

5. NOW LOG OFF and LOG IN to make the changes permanent in the kernel

LINUX Lab Manual Page | 159 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

6. Check whether postfix is already installed

[root@mail ~]# rpm -qa postfix*

Verification:

postfix-2.10.1-6.el7.x86_64

remove postfix if it's already installed

[root@mail ~]# yum remove postfix* -y

7. Do a fresh install of postfix

[root@mail ~]# yum install postfix* -y

8. Edit postfix configuration file by providing domain name

[root@mail ~]# vi /etc/postfix/main.cf

75. myhostname = mail.zoomgroup.com

83. mydomain = zoomgroup.com

:wq!

9. Start the service

[root@mail ~]# service postfix restart

##### OR #####

[root@mail ~]# systemctl restart postfix

10. Create users, assign passwords and test the mail at command prompt by using mail client
utility.

[root@mail ~]# useradd tom

[root@mail ~]# useradd john

[root@mail ~]# passwd tom

[root@mail ~]# passwd john

LINUX Lab Manual Page | 160 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

11. Switch to a user tom and compose a mail to john

[root@mail ~]# su - tom

Verification: tom composing mail to iohn in cli mode

[tom@mail ~]$ mail [email protected]

Subject: test mail from tom


he hello
test mail from tom
mail test 1
Note:New row first column type dot (.) To end the message
Cc: [email protected]

[tom@mail ~]$

[tom@mail ~]$ exit

12. Switch to user john and check the mails

[root@mail ~]# su - john

[john@mail ~]$

13. Type mail and see the output as below

[john@mail ~]$ mail

Result:

Mail version 8.1 6/6/93. Type ? for help.


"/var/spool/mail/john": 1 message 1 new
>N [email protected] Sat Jul 12 04:54 19/601 "test mail from tom"
and 1
Message 1:
From [email protected] Sat Jul 12 04:54:18 2013
Date: Sat, 12 Jul 2013 04:51:38 -0400
From: [email protected]
To: [email protected]
Subject: test mail from tom
Cc: [email protected]

LINUX Lab Manual Page | 161 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

he hello
test mail from tom
mail test 1

and x
You have mail in /var/spool/mail/john

[john@mail ~]$ exit

Configuration of Squirrel Mail to compose the mail on GUI mode

1. Check and install the following packages

[root@mail ~]#yum install httpd* perl-5* php* curl* dovecot* mod_ssl* hunspell-en*

tmpwatch* -y

2. Check and download squirrelmail package from Lab server

[root@mail ~]# firefox ftp://192.168.0.250/pub

Verification:
»% Applications Plstei W.b <8 Fri 14:56 Proot

Indtx of ftp/,a9*.l&« O^SO/pjt>/3r<3.party/ - MOZJU* Frcfpx

Fie Edit Ve%v history Bookmarks Tools Mctp

Vlndn otrif//192108 0 2J. * | W.liom*loC«rKOS * | ♦

«p(/l»2 16»0 25<Vp»Wiqurr^™i(| *> 0- ■ "jl« n *


Vow havt chosan to open:

til tquirr«lm*4-1.4.22-2.ft 16 noar<h«66.64 'pm

Index of ftp://192.16 wtschis: RPM package |) 7 MB)


from ftp-/) 192 168 0.250
♦ Up to hqhrr level directory
What should Flrafox tfo with this flla?

Name Last Modi Red


Qp»n «<tr> Software install (J*-rsult i
gj 192168 0 96 172172015 0216 00 AM
• Sava F4a
£PPUycr-10i<4 tirttt2 8721/2015 0216 00 AM
ygtusa ntr*-}g-201) ll! Do th« aotorruTicali f for flits iht ms from now on 1721/2015 021600 AM
0 mimcam-2 1*3 1186 rpm 1721/2015 0216 00 AM
ntfslq-rhelS np |l721/2015 021600 AM
jUsqurrctmat-l 4 22*2.f< Caned 1X721/2015 02 1 6 00 AM
i A _»/2t/20l5 02 16 00 AM
HiMbnwl 360ta 12752 KB 04(21/2015 02 1600 AM

I *»4*. mi hp//167 isao 290/^4. 1/4 Q

Note: After downloading squirrelmail-1.4.22-2.fcl6.noarch.rpm and php-mbstring-5.4.16-


21.el7.x86_64.rpm packages install with rpm.

LINUX Lab Manual Page | 162 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

[root@mail ~]# cd /root/Downloads

[root@mail ~]# Is

[root@mail ~]# rpm -ivh php-mbstring-5.4.16-21.el7.x86_64.rpm php-mbstring-5.4.16-


21.el7.x86_64.rpm

3. Edit first dovecot configuration file

[root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf

10: disable_plaintext_auth = no (before from line remove # and change from 'yes' into 'no')

100: auth_mechanisms = plain login(before from line remove # and at last add login)

4. Edit dovecot second configuration file

[root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf

25: mailjocation = mbox: ~/mail: INBOX=/var/spool/mail/%u (before from line remove # and
complete the directory by adding spool)

119: mail_access_group = mail(remove # from beginning of line and mail at last)

5. Copy squirrelmail directory data into apache default directory

[root@mail ~]# cp -rv /usr/share/squirrelmail/* /var/www/html

6. Start the services

[root@mail ~]# service postfix restart

Restarting postfix (via systemctl):

##### OR #####

[root@mail ~]# systemctl enable postfix

LINUX Lab Manual Page | 163 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

[root@mail ~]# service dovecot restart

Redirecting to/bin/systemctl restart dovecot.service

##### OR #####

[root@mail ~]# systemctl enable dovecot

[root@mail ~]# service httpd restart

Redirecting to/bin/systemctl restart httpd.service

##### OR #####

[root@mail ~]# systemctl enable httpd

Mail Server Client Configuration

1. Provide the DNS server IP-address

[root@mailclient ~]# vi /etc/resolv.conf

nameserver 192.168.0.x

2. Append the mailserver information in host file

[root@mailclient ~]# vi /etc/hosts

192.168.0. Client_ip_x mailclient.zoomgroup.com mailclient

192.168.0. MailServerx mail.zoomgroup.com mail

:wq!

LINUX Lab Manual Page | 164 www.zoomgroup.com

0
3. Compose the mails via web browser

[root@mailclient ~]# Firefox http://mail.zoomgroup.com

Verification: tom login into an account


^Applications Pieces £j£refoxWeb Browser * « M 15:0* O r.tt

SquirreiMasl - login - MoxiUs Firefox

Fie Edit Ve«v history Bookmarks Tools help

( ) Squ»rrelN*i ■ Login J * |

'w • roomyocp com i v r, fj -

webmail
SquimlMail vereen 1.4.22 2 JcLO
Br the OquirrelMul Project TWta
SquIrrelMall loqln

Name: tom

Password: ......

Legm

1/4 Q

Verification: tom composing the mail to iohn


* Application* Pieces (£cfoxWeb browser ♦ Gi Frl 16:30 Prut

SquvrelHall 1.4.22-2.t<16 - MoziUe Ftrefox

Fie Edit Vienr history Bookmarks Toots Metp

I SquinelMel 1 4 22*2.rclft | ♦ |
v
moil roomyotpcom pfyi (fl? Geo^e Q ^

Last Rafresh. TO- ptinCz^orngroop <en*


Fri. IOIOO aa
i£btdLmul> CCr

INBOX <i> Bcc


Drafts
Sublet: Mill Server Test
Sent
Trash Priority Normal v Receipt. On Read On Delivery
Signature Addresses Seve Oeft Send CHeck Spelling

UltU *bn
kindly please find ths attachicirt at Nail tsrser project data

Thants and Regards


Tea

Send

m4gnall'/.s«^a»ip4 ^ moi^m lr‘/Downlo«4» ^ 'ysi .-iM»4 1 4 - 7 f. <0 1/4 a

LINUX Lab Manual Page | 165 www.zoomgroup.com


Verification: iohn logs into an account
^Application* Flacot trowm ^2 W 16^7 Q root

S^uimlMail - Lofin * MoziUa Href ox

Fie fctfit Vcnr history Bookmark* Tools help

j' jSqu>rt«llM*l - Login j + |

v
s£* <§ ^«»i ioowgr«y.comm c/i ago p»p & E3^ Tooqie Qj ^ ^

webmail ky rH*>« «n0 t*oi«rolM#<l

3i>Jirr*IMo»I vororro 1.4 22-2.fctB


By the 3qum*IM*il Project Taani
SquirrelMall Login
Name: K>rm

Password:

Login

1/4
m| r«Mt^m*ll~~/D«NMa4noO* luotpwiUm/MwH <yi • e4M« I l»|l< M,. . . r* O

Verification: iohn checking the mail which sent bv tom


•% Applications Ptacos Harfm Web R'nww ♦ 0jj Fh 16 10 P root

SquorelH.il 1 4.22-2.f<16 • MoziUa Fircfox

Fie Edit V«nr history Bookmarks Jools help

)SquirralM*l 1 4 22-2.fcl6 | -T |

• . up <cn a £ e*

Folders Current Folder.- Sent


La* Rpfr»*K
<“omoose Addresses Folders Potions Search Help SquirrelMall
Fn iliOT MB
iCb*^ Basil I
Toaala All Viewing Message 1 11 total)
INBOX <i> More Selected TOt Transform Selected Messages
Drafts
INBOX v Mow* *o»w»ld Rwd Unread Delete
Sont
Trash iP*rg*> Thread VXnt
To D Datec Subject e
tom£ zoomgroup.com 11 -08 am Mail Server Test
Toggle All Viewing Message. 1 1 total

mai zoom group cootfut rt igTH-man pnpTO.SHOWALl=06soM = 0&*tartMo*M9o = lAmwIDo* =»NBOX

m -•*<?- «■»/»—framed Bi ■ ’V >

LINUX Lab Manual Page | 166 www.zoomgroup.com


LAB 29: APACHE WEB SERVER

OBJECTIVE:

To Host websites by using APACHE Web Server

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

System 1 System 2

WEB Server WEB Linux Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 167 www.zoomgroup.com

0
ZOO IV
TECH N OLOG IE

Apache Server Configuration to host websites based on names

Example:

www.zoomgroup.com

www.google.com

www.yahoo.com

1. Assign an ip address to the server

[root@web ~]# nmtui

[root@web ~]# service network restart

##### OR #####

[root@web ~]# systemctl enable network

[root@web ~]# ifconfig

2. Configure the hosts file

[root@web ~]# vi /etc/hosts

127.0. 0.1 localhost.localdomain localhost

192.168.0. xl www.zoomgroup.com

192.168.0.xl www.google.com

192.168.0.xl www.yahoo.com

:wq!

3. Edit the httpd configuration File

[root@web ~]# vi /etc/httpd/conf/httpd.conf

At end of line write the following settings

############ NAME BASED ######################

cVirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName www.yahoo.com
Directorylndex yahoo.html
</VirtualHost>

0
ZOOM
TECH NOLOGIES

cVirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName www.google.com
Directorylndex google.html
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName www.zoomgroup.com
Directorylndex zoomgroup.html
</VirtualHost>
wq: (save and quit)

4. Create the webpage files with .html extension

[root@web ~]# cd /var/www/html

[root@web ~]# vi yahoo.html

<html>
<body bgcolor=yellow>
<marquee><hl> THIS IS YAHOO WEBSITE </hlx/marquee>
<h6> HOSTED IN LINUX SESSION </h6>
</body>
</html>

NOTE: - Similarly create zoomgroup.html google.html in /var/www/html folder or


download original website pages then paste into Webserver directory as .html file e.g.
yahoo.html from www.yahoo.com website.

5. Start the Web service

[root@web ~]# service httpd restart

##### OR #####

[root@web ~]# systemctl enable httpd

LINUX Lab Manual Page | 169 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

Web Server Client Configuration

1. Provide the IP Adrress of DNS server if DNS Server is configured on the network

[root@webclient ~]# vi /etc/resolv.conf

nameserver 192.168.0.DNSJP

OR

2. Append the Websites information in host file.

[root@webclient ~]# vi /etc/hosts

192.168.0.X1 www.zoomgroup.com
192.168.0. X1 www.yahoo.com
192.168.0. x! www.google.com

:wq!

3. Open the Browser and access websites

[root@webclient ~]# firefox http://www.yahoo.com

Result:
□ -

YAHOO/ Search Web □ qnm QlM

a t*bi Trending Now


% CrcM
t civic poll* | Plwitom PuMu
i4 Ference 2 irmaflMPakittMi fl»q 7 Srnrto trail CBS6
£3 News 3 AAP Ml A 4<i«M a IND>»H T*M

^ Gomes 4 ISIS AIDS bomb 9 Cbelwp


5 Diet plan 10 Gtaid Mast HI oh Cowt
Style

@ Mews
a Celecmy

P Answers

O R'cewty llu* Itanium Crossmn


O Screen

A SHocfMifl
• • Fbcfcr C/cXrt rmance More

=0 Mcble

Style Fjctc*
Ythoo Screen
>
< 0)44
zievans

LINUX Lab Manual Page | 170 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

Verification:

Access www.google.com via browser

Wtb Mm Nr«> Qcfcd Gnntl men * iGnoait I Sinn m

Google India

f*Google Swrd< | hnFB<nqludy |


Search <*> the «ti O payee Iran India

6 yurt oi Geiad, •*#* rid rvm Tnr t

Google ca n ofcrtd m boa Benaali Tduyu Mafiihi Tail G JI» Mi Ksnmfl* bWirtaAm PUO»*J

i^gitgisna Panrans - **&!. - fo is foaato cara


•TOW- Pnman

Cere

Access www.zoomgroup.com via browser


fz Online ICHP Tia». r 41r * \ ^

4- C I zoomgrojp^on
n- *PP« L &**•*

Products Free Online Training Oemo Testimonials E-Brochure Franchisee

ZOOM ing OLivt Help r Micmaott


(iiiirui
TECHNOLOGIES

Home Online Training Training FAQ Projects Our Services News & Events - Corporate Training Contact Us

jj « M

We are total Network Security experts


Since 1956,7oom Has Provided Futuristic And Reliable Security
W
And Networking Solutions To Clients Spread ,UJJ J.
Across The T>pectrum e » *

III 'll I*
l Hi .

LINUX Lab Manual Page | 171 www.zoomgroup.com


ZOOM
.TECHNOLOGIES.

Apache Server Configuration to host websites based on IP addresses

1. Assigning another Virtual IP on Ethernet interface of the web server for IP Based Hosting

[root@web ~]# nmtui

Edit a connection => enpls7 => IPv4 CONFIGURATION

192.168.0. X1/24

ADD =>

192.168.0. X2/24 = OK

[root@web ~]# service network restart

2. To check the ip address

[root@web ~]# ip addr show

Verification:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN


link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
validJft forever preferredjft forever
inet6 ::1/128 scope host
valid Jft forever preferredjft forever
2: enpls7: BROADCAST,MULTICAST,UP,LOWERJJP> mtu 1500 qdisc pfifojast state UP qlen
1000
link/ether 00:0c:29:6a:f2:a6 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.X1/24 brd 192.168.0.255 scope global enpls7
validjft forever preferredjft forever
inet 192.168.0.X2/24 brd 192.168.0.255 scope global secondary enpls7
validjft forever preferredjft forever
inet6 fe80::20c:29ff:fe6a:f2a6/64 scope link
validjft forever preferredjft forever

3. Makesure the hostfile configuration by providing new ip to website

[root@web ~]# vi /etc/hosts

127.0. 0.1 localhost.localdomain localhost


192.168.0. X1 www.yahoo.com
192.168.0. X1 www.zoomgroup.com
192.168.0. X2 www.google.com
:wq!

LINUX Lab Manual Page | 172 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

4. Edit the Webserver file by providing new IP address

[root@web ~]# vi /etc/httpd/conf/httpd.conf

<VirtualHost 192.168.0.X2:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName www.google.com
Directorylndex google.html
</VirtualHost>
:wq

5. Start the service

[root@web ~]# service httpd restart

OR

[root@web ~]# systemctl restart httpd

Web Server Client Configuration

1. Open the Browser and type

[root@webclient ~]# Firefox and

Verification:http ://192.168.0.X2
Gaofc* Morlla Tircfo* l5 X
9* Ldt SW* Nfarr lock Qet>

^ • C - i .
^ Gffcng 2«ted Ldtnthr*:^

Wob imoqtt 14m Nun 0<K 6m»l moro « iGooqio | SIQH m

f Google SeergTl hn Feoonq Lucfcy |


'

6 or Oonofl, r«* nd now It; c.


Google cc.n olervtf m Hgta Bengali Teluy. Mardhi Taaii Ck^araii Mata}atom Puf\a6i

AiNMTrsrig PfQ^ivrfiS • &lOJ Gt<g» - Gc 10 COT

00009

LINUX Lab Manual Page | 173 www.zoomgroup.com

0
Port based websites configuration

1. Edit the Webserver file by providing port numbers

[root@web ~]# vi /etc/httpd/conf/httpd.conf

Listen 8000

<VirtualHost *:8000>

ServerAdmin [email protected]

DocumentRoot /var/www/html

ServerName www.zoomgroup.com

Directorylndex zoomgroup.html

</VirtualHost>

:wq

2. Start the service

[root@web ~]# service httpd restart

Web Server Client Configuration

1. Provide the ip address of DNS server, if DNS Server is configured.

[root@webclient ~]# vi /etc/resolv.conf

namesever 192.168.0.DNS_1P

2. Append the websites information in host file.

[root@webclient ~]# vi /etc/hosts

#### append these names ###

192.168.0.X1 www.zoomgroup.com

192.168.0.X1 www.yahoo.com

192.168.0.X1 www.google.com

LINUX Lab Manual Page | 174 www.zoomgroup.com

0
ZOOM
TECH NOLOGIES

3. Open the Browser and type

[root@webclient ~]# firefox and access http://www.zoomgroup.com:8000

Verification:
J2 OnancICMPUMiflnii M^||

4" C I zoomgrajp^on

Products Free Online Training Demo Testimonials E-Brochure Franchisee

ZOOM O Livt Help Microsoft


(Ktirti »
TECHNOLOGIES

Home Online Training Training FAQ Projects Our Services News & Events • Corporate Training Contact Us

•If : : 71
We are total Network Security experts
Since 1906. Zoom Has Provided Futuristic And Reliable Security
1
And Networking Solutions To Clients Spread r t 3‘J J 9u
Across The Spectrum ■ »


II
W | ••
« ^ r,
SB H -3

LINUX Lab Manual Page | 175 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

LAB 30: AUTHENTICATION ON APACHE WEB SERVER

OBJECTIVE:

To authenticate clients accessing the website hosted on an Apache Server.

PRE-REQUISITE:

Two Machines with Linux Installed.Continue from the previous exercise

TOPOLOGY:

Systeml System2

WEB Server WEB Linux Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 176 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

Web Server Authentication

1. Contnue from the previous exercise.Edit the Webserver file

[root@web ~]# vi /etc/httpd/conf/httpd.conf

<Directory /var/www/html>

AuthName "zoom-secure"

AuthUserFile /mnt/web

AuthType Basic

Require Valid-User

</Di recto ry>

:wq!

2. Create a user and set password for web authentication

[root@web ~]# useradd tom

[root@web ~]# htpasswd -c /mnt/web tom

3. Start the service

[root@web ~]# service httpd restart

LINUX Lab Manual Page | 177 www.zoomgroup.com

0
ZOOM
TECH N OLOG IE!

Web Client Authentication

1. Provide the IP address of DNS server if DNS Server is configured on the network

[root@webclient ~]# vi /etc/resolv.conf

namesever 192.168.0.DNS IP

2. Append the Websites' information in host file.

[root@webclient ~]# vi /etc/hosts

192.168.0.XI www.zoomgroup.com

192.168.0.XI www.yahoo.com

192.168.0.XI www.google.com

3. Open the Browser and type

[root@webclient ~]# firefox http://www.zoomgroup.com

Verification: client trying to browse zoomeroup website

LINUX Lab Manual Page | 178 www.zoomgroup.com

0
Verification: After giving the rteht credentials client can browse the website
Tz OWr* ZCHP TiaMnf IT *

4" C ioomgrojp-con ei£? 5


!*• I’ iw

Products Free Online Training Demo Testimonials E Brochure Franchisee

ZOOM lissing Link intNitumstNtiwuHKiNu Live Help scarce


TECHNOLOGIES

om® Online Training Training FAQ Project# Our Services

We are total Network Security exp IS


Since 1996, Zoom Has Provided Futuristic And R ble Security
And Networking Solutions To Clients Spread
Across I hr Spectrum * »

LINUX Lab Manual Page | 179 www.zoomgroup.com


LAB 31: WEBMIN ADMINISTRATION

OBJECTIVE:

To use WebMin browser based tool to manage the network services

PRE-REQUISITE:

Two Machines with Linux Installed.

TOPOLOGY:

Systeml System2

WEBMIN Server WEBMIN Client

IP Address 192.168.0.X IP Address 192.168.0.X

LINUX Lab Manual Page | 180 www.zoomgroup.com

0
ZOOM
TECH NOLOGIE!

GUI Based application to manage network via browser

1. Download webmin application from LAB server

[root@server ~]# firefox

ftp://192.168.0.250

Verification:
Application* ■cfoxWeb b'owm * OS M21:10 Pn«

Fie Edit Vew history Bookmarks Tools help

■ litdti of ftp .7192 108 0 Z5C/p. | ■»

i i 13“ Q
Opnninj wrbmiii-1 360tar 91

^oo nave cnaven 10 open

lilwabmln-1 S6O.tar.9z
Index of ftp://192.16 wHchis: Cr>p arch*** (12 5 M31
from ftp//192 166 0.250
4* Up to hgher level directory
Wh«t should Firefox do with this Rl«?
Name Last Modi Red
Open w*f« Armi.a Manager |default;
ft 192168 0 96 /21/2015 02 1 6 00 AM
l| NFtaye* 1 0t<4 ta bit • Seva F>le /21/2015 0216 00 AM
yjhisantft-lg-20111 1 /2L/201S 021600 AM
Do mu automatic ally fee 61 as Idea ms from now an
gjmintcam-2 1-1 /21/201S 0216 00 AM
(j| nHs3g-rh»l5 np /21/2015 02 1 6 00 AM
y|squ»re<ma4 l 4 22-2.1 Cant at /21/2015 02 1 6 00 AM
y i^u.ratmai-1 4.22-2.1 /21/2015 0216 00 AM
jj| 160 tat 92 U75:K» 04/21/2015 02 16 00 AM

-/O.wiMtt m ^ l*ln *rJJ \ WlMO/Wf. 1/4 o

2. Check the downloaded package

[root@ server ~]# cd /root/Downloads

Verification:

[root@ server Downloads]# Is

webmin-1.360.tar.gz

3. Extract the package

[root@server Downloads]# tar -xvzf webmin-1.360.tar.gz

4. To list extracted directory

[root@server Downloads]# Is

Verification:

Webmin-1.360 webmin-1.360.tar.gz

LINUX Lab Manual Page | 181 www.zoomgroup.com

0
ZOOM
.TECHNOLOGIES.

5. Enter into webmin package directory

[root@server Downloads]# cd webmin-1.360

[root@ server Downloads]# Is

6. To install webmin run the following command.

[root@server webmail ]# ./setup.sh

Verification:

* Welcome to the Webmin setup script, version 1.360 *

Webmin is a web-based interface that allows Unix-like operating


systems and common Unix services to be easily administered.

Installing Webmin in /opt/webmin-1.360 ...

Webmin uses separate directories for configuration files and log files.
Web server port (default 10000): <press enter>
Login name (default admin): <press enter>
Login password:
Password again:
The Perl SSLeay library is not installed. SSL not available.
Start Webmin at boot time (y/n):y

Webmin has been installed and started successfully. Use your web browser to go to

http://localhost:10000/ and login with the name and password you entered previously.

LINUX Lab Manual Page | 182 www.zoomgroup.com

0
7. Open the Browser, to access it

[root@server opt]#firefox http://localhost:10000

Verification: Providing username and password


^Applications Places System 4 ■* TueAug 18,11:26PM root

Mozilla Firefox _ a
File Edit view History Bookmarks Tools help

https-Z/1 ocalhostioooo,1 v

^1 [ V localhost http-. localhost 10000 « J| {§v G xxjle f||

Login to Webmln

Mbu must enter a username and password to login to the


tvcbmin server on localhost.

username admin ]

Password
J
Login Clear j
□ Remember login permanently?

HI root^web iioomshare. Mozilla Firefox

Verification: Installing DNS applications on webmin interface


^Applications Places System d£ ^ a?1 lueAug 18.11:33PM root

g root@web/zoomshare % wetxnin 1.360 on web 9 rootQmeb:- root@web:

LINUX Lab Manual Page | 183 www.zoomgroup.com


ZOOM
TECH NOLOGIE!

Verification: Installing DNS applications


** Applications Places System ^ 3^ 4 TUe Aug 18.11:34 PM root

Webmin 1.360 on wcb.zoomgroup.com (Centos Linux 6.3) - Mozilla Firefox

File Edit view History Bookmarks Tools Help

w Webmin 1360 on web.zoomgro [ ■{> I

^ » local-os: it-.' local ho st .me ^ £1 (if* Ml 4


Login: admin Module Index
61 Webmin Help.. Install Package
0 System
Installing package(s) with command yur -y Install kiM ..
0 Servers
Apache Webserver Loadn] plugins: f*&te*uUr ror, refTeih pnc^nueiat. secuilty
losrtirQ fdrror sprefls trrw raeherl bostfile
BIND DNS Server Selling uu Instill Pioic&s
CVS Server Resolv-.fig Of prrxlpnfiM
> Rurtnxnq transaction check
DHCP Server > Pnrtoff bnw.Kl M 32:9 8 2 e.ie.rri.m uitl Of Instilled
Dovecot IMAPVP0P3 Procnunq Drpfndpncy: bind-lib* - 1? 9 8.2-0 1# ttl e!6 for PKIUKIT: 32 bind-9.8.2-8 10 rcl rl6.iBfi 64
Server > ProriKsino Or pendency ? UM85.S0 8l<H64blt) for parlogr: 32Dind 9 8.2 t.IB. rcl elfr.»* M
Processing Dppmdrncy: Ubbamf9.vj 880 l64bit) foi pockncjr 3? bind-9 8.2-8 10 rcl rl6.x86 64
Fetchmail Mail Retrieval > Processir>g Dependency: U01SC.SO.83< M64011) Tor packJQC: 32:Dind 9.8.2 0.10. rCl.el6.xt>6 64
Ftox FTP Proxy - -» Procming Drpmdrncy: libiiccfg so B3(|(64hit) for piduspr: 32:bind-9 8 2-8.10. rcl el6 186 64
> Processing Dependency: lioisccc.so.00O I64blt) tor package: 32:Dino 9.8.2 9.10.rci.ci6.x8b 64
|abber IM Server --> Procming Dependency: liblwret.%a 00() 164bit) for pneknge: 32 Dind-9.8.2-0 10. rcl el6.x&6 64
Majordomo List Manager > Runnlne I'jitiaction chcik
—> Purkagf bind-U6s.x&6 64 12:9 B 2-B.18.rcl.eU will be metalled
Mysqi Database Server » Fin lifted DeperuJertcy Resolution
opens LP server
Deye rdetciei Resolved
Postfix configuration
PostgneSOL Database
Server PaotdQf Arch Version Repository Size

ProFTPD Server Installing


Procmail Mail Filter bind *96 64 32 9.0.2 .O.l0.rcl.cl6 core 4.0 M
Installing for aeper**neies:
QMail configuration bind libs x86 64 329.8.20.10.rcl.el6 core 87i k
Read user Mail
Transaction Siaanary
SSM Server
Samba Windows File install 7 PBC«89?|»)

Sharing
Total Oawiload lire: 4.8 8
Send mail Configuration Installed size: 9.4 M
spamAssassin Mail Filter OoMiloodmg Pakagn:

Squid Analysis Report Total 9.9 Mtys | 4.B m 90:90


Generator Running rgnthei.k.<h:&ou
fanning Transaction Test
Squid Proxy Server
tJ
9 loot gwH] '/oomshare. , %, Webmin 1.360 on web.... H root <3 web:- a ioot@web-

Interface for DNS configuration

Applications Places system ^ TUe Aug 18,11:34 PM root


*»■ #
Webmin 1.360 on web.zoomgroup.com (Centos Linux 6.3) - Moziila Firefox HI x

File Edit View History Bookmarks Tools Help

Webmin 1.360 on web^oomgro <=■ j

^ » local host ttps 'local host, XKJO * f.! ify Ml 4


! S"
Login: admin Module Config Search Docs
GJ webmin
BIND DNS Server
BIND version 9.8.2
0 System
0 Servers
iil Global Server Options
Apache Webserver
BIND DNS Server
CVS Serve*
DHCP server
Dovecot IMAP;POP3 Other DNS Logging and Access Control
w
Flies and
#
For waiding and Addresses and
Server Servers Errors Lists Directones Transfers Topology
Fetchmail Mail Retrieval
Frox FTP Proxy
|abber IM Server
Majordomo List Manager
Miscellaneous
m
Control interface DNS Keys
[o;
Zone Defaults Ouster Slave Setup RNDC
MySQL Database Server
Options Options Servers
opens LP server
Postfix Configuration
PostgreSOL Database
Server
ProFTPD Server Edit Config File
Procmail Mail Filter
OMail configuration 3 Existing DNS Zones
Read user Mail M
create master zone | create slave zone. | create stub zone. | create forward zone | create delegation zone. |
5SH Server Oeate zones from batch hie.
Samba Windows File
Sharing
Sendmail Configuration
SpamAssassin Mall Filter
§
Root zone
© 0
0
0000:1
0
127.0.0.1
0
local host
squid Analysis Report
Generator
Squid Proxy Server E

IJ root giweb Izoomshare ^ vvebmm .. 36^^^^^B|~a rootPweb:- S root®web-

LINUX Lab Manual Page | 184 www.zoomgroup.com


ZOOM
.TECHNOLOGIES.

8. To Change the admin password after webmin installation

[root@server opt]# cd webmin-1.360

[root@ server webmin-1.360]# ./changepass.pl /etc/webmin/ admin admin

9. To Uninstall webmin

[root@ server opt]# sh /etc/webmin/uninstall.sh

LINUX Lab Manual Page | 185 www.zoomgroup.com

0
MCSE-2012 FUII Course
MICROSOFT CERTIFIED SOLUTIONS EXPERT
Practicals in real-time environment. Detailed curriculum with all 5 papers
Duration: 1 Month | 4 Hrs Per Day (starts on 30* of every month)
Batches: Morning: 8.30 to 10.30 • Afternoon: 2.00 to 4.00 • Evening: 7.30 to 9.30 \
CCNA (v 2.0) Full Course
CISCO CERTIFIED NETWORK ASSOCIATE Complete Package
Cisco Routers with BSNL/TELCO MUX & Live Channelised El for Only
Duration: 1 Month | 4 Hrs Per Day (starts on 30* of every month)
Batches: Morning: 8.30 to 10.30 • Afternoon: 2.00 to 4.00 • Evening: 7.30 to 9.30

Fees: ? 5,900/-
+ 14% Service Tax

Practicals on Live Web Administration + Integration of Windows with Linux/Unix (Samba Server)
Duration: 3 Months
Duration: 2 Weeks | 4 Hrs Per Day (starts on is* &30,h of every month) 4 Hrs Per Day
Batches: Morning: 8.00 • Afternoon: 1.30 • Evening: 7.00

I'.'iilillWIliJJiJIhAHiWIlWjWlllliltWIi: 100%
►/
• Ethical Hacking, Cyber Security and Firewall • Open Source: A glimpse into advance Linux
• VMware vSphere and MS Private Cloude • Cisco WAN Technology & Collaboration

Free MCSE & CCNA Exam Practice Questions GUARANTEED


[UAr | Ethical Hacking &
EI1UE I Countermeasures Expert
Course is mapped to EHCE course from US-Council (www.us-council.com)
Fees: ? 9,500/-
JOB
+ 14% Service Tax.
(Pre requisite is CCNA / MCSE / LINUX) ASSISTANCE
1
Duration: 2 Weeks | 4 Hrs Per Day (starts on is " & 30th of every month)
Batches: Morning: 7.30 or Evening: 6.00

CCNP R&S
rcisco CERTIFIED NETWORK PROFESSIONAL^
Duration: 1 Month | 4 Hrs Per Day (starts on 15th of every month)
Batches: Morning: 7.30 • Afternoon: 2.00 • Evening: 6.00 Fees: ^ jBfOCG/;
• Labs on latest routers with IOS version 15.X Introductory Special Offer
Monitoring, Diagnostics & Troubleshooting Tools
• PRTG • Wireshark • SolarWinds, etc.
Fees: ? 5,500/-
+ 14% Service Tax
Exam Practice Challenge Labs

CCIE R&S
tcisco CERTIFIED INTERNETWORK EXPERT
Duration: 1 Month | 4 Hrs Per Day (starts on is1" of every month)
Batches: Morning: 7.30 • Evening: 6.00
• Individual Rack For Every Student Fees: ?
• Real time scenarios by 20+ years experienced CCIE certified industry expert who
has worked on critical projects worldwide. Introductory Special Offer
Written + Lab Exam Focus Fees: ? 9,999/-
FREE Full Scale 8 Hours Exam Lab Included + 14% Service Tax
Unlimited Lab Access For 1 Year
Fees: ? 2,500/-
1
Duration: 2 Weeks | 4 Hrs Per Day (starts on is* & 30* of every month) + 14% Service Tax
Batches: (Contact the Counselors for the next available batch)

Fees: 2,500/-
Duration: 2 Weeks | 4 Hrs Per Day + 14% Service Tax
Batches: (Contact the Counselors for the next available batch)

Fees: ? 2,500/-
Duration: 2 Weeks | 4 Hrs Per Day (starts on 15* & 30* of every month) + 14% Service Tax
Batches: (Contact the Counselors for the next available batch)

CCNA SECURITY (Pre requisite is CCNA R&S)


Fees: ^ 7,500/-
CISCO CERTIFIED NETWORK ASSOCIATE - SECURITY]
+ 14% Service Tax
Duration: 2 Weeks | 4 Hrs Per Day (starts on 15* of every month)
Batches: Morning: 7.30 or Evening: 6.00

CCNP SECURITY (Pre requisite is CCNA Security at ZOOM)


Fees: ^ 9,500/-
CISCO CERTIFIED NETWORK PROFESSIONAL - SECURITY
Duration: 2 Weeks | 4 Hrs Per Day (starts on 30* of every month) + 14% Service Tax
Batches: Morning: 7.30 or Evening: 6.00

CCIE SECURITY (Pre requisite is CCNA & CCNP Security at ZOOM)


Fees:^15,500/-
CISCO CERTIFIED INTERNETWORK - SECURITY.
+ 14% Service Tax
Duration: 1 Month | 4 Hrs Per Day
Batches: (Contact the Counselors for the next available batch)

VMware vSphere (Pre requisite is MCSE) Fees: ? 4,950/-


Duration: 1 Month | 4 Hrs Per Day (starts on 15* of every month) + 14% Service Tax
Batches: Morning: 7.30 and Evening: 7.30

VMware vCloud (Pre requisite is VMware vSphere) Fees: ? 2,500/-


Duration: 1 Week | 4 Hrs Per Day (starts on 15* of every month) + 14% Service Tax
Batches: Morning: 9.30 to 11.30

■diiJd'iJiiiniJhnHHT Fees: ^ 5,500/-


Duration: 2 Weeks | 4 Hrs Per Day + 14% Service Tax
Batches: (Contact the Counselors for the next available batch)

We also offer the following courses (Contact the Counselors for the next available batch)
► CCNA Voice @ ^7,500/- ► CCNA Data Center @ ^7,500/-
► CCNP Voice @ ?9,500/- ► CCNP Data Center ?9,500/-
► CCIE Collaboration @ 5,500/- ► CCIE Data Center 5,500/-
► IPv6 Migration @ ^5,500/-
► All Senior Engineers of Zoom working on Live projects
FACULTY * Training Engineers of British Army, CISCO, CMC, GE, BSNL, Tata Teleservices and
Several Corporates etc for 18 Years.

www.zoomgroup.com
FREE Training
Zoom Technologies offers a number of free resources for the professional development of network
engineers.

Register on our website to get access to the video recordings of live sessions on:

■ MCSE - Windows Server 2012


■ Cisco - CCNA "1
■ Cisco-CCNP r All Tracks (R & S, Security and Voice)
■ Cisco-CCIE J
■ Exchange Server 2013

- Ethical Hacking and Countermeasure Expert (www.us-council.com)

Find us at: www.zoomgroup.com

Like us on Facebook and get access to free online webinars as well as special offers and discounts.
https://www.facebook.com/ZoomTechnolgies

Online Training
Online Training at Zoom is a cost effective method of learning new networking skills from the
convenience of your home or workplace.

Taking an online training course has many advantages for everyone (Freshers / Working Professionals).
Zoom offers online training for the highly coveted CCNA, CCNP and CCIE courses as well as MCSE,
Linux, VMware, Ethical Hacking and Firewalls, IPv6 with more courses planned for the near future.
These are live instructor led courses, using Cisco WebEX. Check out our online course offerings at:
http://zoomgroup.com/online_course

Job Opportunities
There is a high demand for network and security professionals at all times. Apart from job opportunities
in India and the Middle East, network and security administrators are also sought-after in the US and
Europe.

If you do not have the right skills, then get them now! Choose the experts in network and security
training, an organization which has already trained over one hundred thousand engineers.

For the latest job openings in networking and security, register and upload your resume on:
http://zoomgroup.com/careers or visit zoom to choose job offering from several multinational
companies.
0
ABOUT US

ZOOM Technologies India Pvt. Ltd. is a pioneering leader in network and security train-
ing, having trained over a hundred thousand engineers over the last two decades.

We offer a world class learning environment, with state-of-the-art labs which are fully
equipped with high-end routers, firewalls, servers and switches. All our courses are
hands-on so you'll get much needed practical experience.

The difference between us and the competition can be summed up in one simple sen-
tence. Our instructors are real-time network professionals who also teach.

Zoom has designed, developed and provided network and security solutions as well as
training to all the big names in the Indian industry, for the public sector as well as corpo-
rate leaders. Some of our clients are:

TATA
BSNL
VSNL
Indian Railways
National Police Academy
Air Force Academy
IPCL- Reliance Corporation
CMC
British Army

No other training institute can boast of a customer base like this. This is the reason for
the resounding success of our networking courses. If you do not have the right skills, then
get them now. Come, join the experts!

Training Centers in Hyderabad, India.

Banjara Hills Ameerpet Secunderabad Dilsukhnagar


HDFC Bank Building, 2nd Floor, # 203, 2nd Floor, Navketan Building, 1st Floor, # 16-11-477/B/1 &B/2,
Road #12, Banjara Hills, HUDA Maitrivanam, Ameerpet, 5 Floor, # 501 Shlivahana Nagar, Dilsukhnagar,
Hyderabad - 500 034 Hyderabad-500 016 Secunderabad - 500 003 Hyderabad - 500 060
Telangana, Telangana, Telangana, Telangana,
India. India. India. India.

Phone: +91 40 23394150 Phone: +91 40 39185252 Phone: +91 40 27802461 Phone: +91-40-24140011
Email: [email protected] Email: [email protected] Email: [email protected] Email: [email protected]

website: www.zoomgroup.com

You might also like