Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

System Administration and Network Management

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

System Administration and

Network Management
Lecture 3: Network Management and
Configuration
(by Seiyfu Yesuf)
Asu Dept of Computer Science(March 2022)
Reminders/logistics
2

 Starting Network Services


 Configuring NFS
 Configuring Network Information System
(NIS)
Introduction to Linux

UNIX

Unix is a multi-user, multi-tasking operating system.


You can have many users logged into a system
simultaneously, each running many programs.
It's the kernel's job to keep each process and user separate
and to regulate access to system hardware, including cpu,
memory, disk and other I/O devices.
Introduction to Linux

What is LINUX

Linux is a free Unix-type operating system originally


created by Linus Torvalds with the assistance of
developers around the world.
It originated in 1991 as a personal project of Linus
Torvalds, a Finnish graduate student.
The Kernel version 1.0 was released in 1994 and today
the most recent stable version is 2.6.9
Developed under the GNU General Public License , the
source code for Linux is freely available to everyone.
Introduction to Linux

LINUX Distributions
Mandrake: http://www.mandrakesoft.com/
RedHat: http://www.redhat.com/
Fedora: http://fedora.redhat.com/
SuSE/Novell: http://www.suse.com/
Debian: http://www.debian.org/

Red Hat Enterprise Linux is a Enterprise targeted Operating


System. It based on mature Open Source technology and
available at a cost with one year Red Hat Network subscription
for upgrade and support contract.
Introduction to Linux

UNIX Structure
Introduction to Linux

UNIX File System


Introduction to Linux

File System
Each node is either a file or a directory of files, where the
latter can contain other files and directories.
You specify a file or directory by its path name, either the
full, or absolute, path name or the one relative to a
location.
The full path name starts with the root, /, and follows the
branches of the file system, each separated by /, until you
reach the desired file, e.g.:
/home/condron/source/xntp
Introduction to Linux

Structure of Standard Directories in


Unix/Linux
/ The ancestor of all directories on the system; all other
directories are subdirectories of this directory, either
directly or through other subdirectories.
/bin Essential tools and other programs (or binaries).
/dev Files representing the system's various hardware
devices. For example, you use the file `/dev/cdrom' to
access the CD−ROM drive.
/etc Miscellaneous system configuration files, startup files,
etc.
Introduction to Linux
Structure of Standard Directories in
Unix/Linux
/home The home directories for all of the system's users.
/lib Essential system library files used by tools in `/bin'.
/proc Files that give information about current system
processes.
/root The superuser's home directory, whose username is
root. (In the past, the home directory for the superuser was
simply `/'; later, `/root' was adopted for this purpose to
reduce clutter in `/'.)
Introduction to Linux
Structure of Standard Directories in
Unix/Linux
/sbin Essential system administrator tools, or system
binaries.
/tmp Temporary files.
/usr Subdirectories with files related to user tools and
applications.
Introduction to Linux
Directories, Files and Inodes
Every directory and file is listed in its parent
directory.
In the case of the root directory, that parent is itself.
A directory is a file that contains a table listing the
files contained within it, giving file names to the
inode numbers in the list.
The information about all the files and directories is
maintained in INODE TABLE
An Inode (Index Nodes) is an entry in the table
containing information about a file (metadata)
including file permissions, UID, size, time
stamp, pointers to files data blocks on the disk etc.
Introduction to Linux

Users, Groups and Access Permissions


In UNIX/LINUX, there is a concept of user and an
associated group

The system determines whether or not a user or


group can access a file or program based on the
permissions assigned to them.

Apart from all the users, there is a special user


called Super User or the root which has permission
to access any file and directory
Introduction to Linux

Access Permissions
There are three permissions for any file, directory
or application program.

The following lists the symbols used to denote


each, along with a brief description:

r — Indicates that a given category of user can


read a file.

w — Indicates that a given category of user can


write to a file.

x — Indicates that a given category of user can


execute the file.
Introduction to Linux

Access Permissions
Each of the three permissions are assigned to
three defined categories of users.
The categories are:

owner — The owner of the file or


application.
group — The group that owns the file or
application.
others — All users with access to the
system.
Introduction to Linux

Access Permissions
One can easily view the permissions for a file by
invoking a long format listing using the command
ls -l.

For instance, if the user juan creates an executable


file named test, the output of the command ls -l test
would look like this:

-rwxrwxr-x 1 juan student 0 Sep 26 12:25 test


Introduction to Linux

Moving in Directories
cd try_it
Changes the directory to try_it
pwd
Prints present working directory (e.g.
/home/smith/try_it)
cd .. Move to superior directory
pwd : Prints /home/smith
cd /home The absolute path
The command mkdir my_dir

makes new directory my_dir (the path is given


relative) as a subdirectory of the current directory.
Introduction to Linux

Copy File

The command cp file_1 file_2

copies file_1 to file_2. The both files must be in the


same working directory. If they are in various
directories, the path must be given.
The command rmdir your_dir
removes directory your_dir if it is empty.
Introduction to Linux

Rename and/or Move the File

The command mv file_1 file_2

moves file_1 to file_2

The both files must be in the same working


directory.

If they are in different directories, the path must be


given.

The file_1 is removed from the disk.


Introduction to Linux

Remove File
The command rm file_a
removes the file_a from the system
If you use wildcard. For example
rm h*c
you will remove all files beginning with h and
ending with c which are in working directory.
If you write
rm *
you will erase all files from your working directory.
Introduction to Linux

Access Permission of File/Directory


The ownership of the file or directory can be
changed using the command
chown <owner> <file/directory name>
The group of the file or directory can be changed
using the command
chgrp <group> <file/directory name>
The permissions of the file can be changed using
chmod command
chmod -R ### <filename or directory>
-R is optional and when used with directories will
traverse all the sub-directories of the target
directory changing ALL the permissions to ###.
Introduction to Linux

Access Permission of File/Directory


The #'s can be:
0 = Nothing
1 = Execute
2 = Write
3 = Execute & Write (2 + 1)
4 = Read
5 = Execute & Read (4 + 1)
6 = Read & Write (4 + 2)
7 = Execute & Read & Write (4 + 2 + 1)
NFS (Network File System)
 The most commercially successful and widely available
remote file system protocol
 Designed and implemented by Sun Microsystems

 (Walash et al, 1985; Sandberg et al, 1985)

 The NFS protocol is public domain

 Sun sells that implementation to all people for less than


the cost of implementing it themselves
 Evolved from version 2 to version 3 (which is the common

implementation today).
NFS Overview
 Views a set of interconnected workstations as a set of
independent machines with independent file systems
 The goal is to allow some degree of sharing among
these file systems (on explicit request)
 Sharing is based on client server relationships
 A machine may be both client and server
 The protocol is stateless
 Designed to support UNIX file system semantics
 The protocol design is transport independent
NFS Services
 The NFS server package includes three facilities, included
in the portmap and nfs-utils packages.

 portmap : It maps calls made from other machines to the


correct RPC service.

 nfs: It translates remote file sharing requests into requests


on the local file system.

 rpc.mountd: This service is responsible for mounting


NFS Configuration Files

 /etc/exports : Its a main configuration file of NFS, all


exported files and directories are defined in this file at
the NFS Server end.

 /etc/fstab : To mount a NFS directory on your system


across the reboots, we need to make an entry in
/etc/fstab.

 /etc/sysconfig/nfs - or /etc/nfsconfig: Configuration file


of NFS to control on which port rpc and other services are
listening and the NFS version used .
Server Installation + Setup
 yum install nfs-utils nfs-utils-lib
 yum install portmap (NFSv2 or NFSv3) -OR-

 /etc/init.d/portmap start
 /etc/init.d/nfs start
 chkconfig --level 35 portmap (rpcbond) on
 [chkconfig --level 35 nfs on

 /etc/exports
/nfsshare 172.27.0.0(rw,sync,no_root_squash)

 exportfs -a : Exports all shares listed in /etc/exports, or given name


 exportfs -v : Displays a list of shares files and options on a server
 exportfs -u : Unexports all shares listed in /etc/exports, or given name
 exportfs -r : Refresh the server’s list after modifying /etc/exports
NFS Options
 ro: With the help of this option we can provide read only
access to the shared files i.e client will only be able to read.

 rw: This option allows the client server to both read and
write access within the shared directory.

 sync: Sync confirms requests to the shared directory only


once the changes have been committed.

 no_root_squash: This phrase allows root to connect to the


designated directory.
NFS Client
• showmount -e <NFS Server>

• showmount –d
• mount -t nfs <NFS Server>:/nfsshare /mnt/nfsshare

• /etc/fstab
- <NFS Server>:/nfsshare /mnt nfs defaults 0 0
See text or man page for mount options
• df -h
RPC(BIND)
 Transport: both TCP and UDP

 Data types: atomic types and non-recursive structures

 Pointers are not supported

 Complex memory objects (e.g., linked lists) are not


supported

 NFS is built on top of RPC


The mount protocol
 Is used to establish the initial logical connection between a
server and a client

 Each machine has a server process (daemon) (outside the


kernel) performing the protocol functions

 The server has a list of exported directories (/etc/exports)

 The portmap service is used to find the location (port


number) of the server mount service
The mount protocol
 Client’s mount process send message to the server’s portmap (or RPCBIND)
daemon requesting port number of the server’s mountd daemon

 Server’s portmap (or RPCBIND) daemon returns the requested info

 Client’s mountd send the server’s mountd a request with the path of the flie
system it wants to mount

 Server’s mountd request a file handle from the kernel


- If the request is successful the handle is returned to the client
- If not error is returned

 The client’s mountd perform the mount() system call using the received file
handle
What is NIS?
 Problems in running a distributed computing environment
:
 Each Workstations has its own copies of common
configuration files such as passwd, group, and hosts files
 These files must be consistent and every changes to these
common files much be propagated to every hosts on the
network
What is NIS?
 The NIS, released by Sun in 1980s, was the first “prime
time” administrative database to address these
problems.
 It was originally called the Sun Yellow Pages, but
eventually had to be renamed for legal reasons. Many
vendors have licensed Sun’s code, making NIS the most
widely-supported network database system
What is NIS?
 It is a distributed database system that replaces copies
of commonly replicated configuration files with a
centralized management facility
 Instead of having to manage each host’s files, you
maintain one database for each file on one central
server
NIS Masters, Slaves, and Clients

NIS
MASTER
SERVER

NIS SLAVE NIS SLAVE


SERVER SERVER

CLIENT CLIENT CLIENT CLIENT


NIS Servers
 An NIS server is a machine storing a set of maps that
are available to network machines and applications.
 NIS master server
 containsthe set of maps that you, the NIS administrator,
create and update as necessary.
 Each NIS domain must have one, and only one, master server.
NIS Servers
 NIS Slave server
A slave server has a complete copy of the master set of NIS
maps. Whenever the master server maps are updated, the
updates are propagated among the slave servers. The
existence of slave servers allows the system administrator to
evenly distribute the load resulting from answering NIS
requests. It also minimizes the impact of a server becoming
unavailable.
NIS Elements
 NIS Domains
 An NIS domain is a collection of machines that share a
common set of NIS maps. Each domain has a domain name
and each machine sharing the common set of maps belongs
to that domain.
 Domain names are case-sensitive.
 NIS maps are essentially two-column tables. One column
is the key and the other column is information value
related to the key. NIS finds information for a client by
searching through the keys. Some information is stored in
several maps because each map uses a different key.
NIS Elements
 Maps for a domain are located in each server's
/var/yp/domainname directory.
 For example, the maps that belong to the domain test.com
are located in each server's /var/yp/test.com directory.
 An NIS Makefile is stored in the /var/yp directory of
machines designated as a NIS server at installation time.
Running make in that directory causes makedbm to create or
modify the default NIS maps from the input files.
NIS Elements

 NIS daemons

Daemon Functions
ypserv Server process

ypbind Binding process

ypxfrd High speed map transfer

rpc.yppasswdd NIS password update


daemon
NIS Query

Client Side Server Side

Application ypbind ypserv

getpwuid C Library ndbm C Library

The Filesystem
Basic NIS Management
 Installing a new NIS Environment, building Master and slave servers
 Starting the ypserv daemon, which enables the system to act as NIS
Server
 Adding new slave servers when growth of your network
 Modifying the client’s administrative files
 Starting the ypbind daemon, allowing the client to make NIS
requests
 Ypbind, yppasswdd , ypserv, portmap, ypbind ,ypxfrd NIS server
services
 Ypbind & portmap are NIS client services
Building NIS Master Server

NIS Sever

Local /etc/passwd root/system


local logon
Local /etc/shadow

NIS Passwd map


source file : say normal user
passwd.yp
local logon
through NIS (if
permitted)
ypserv ypbind
Changing Password in NIS

NIS Master Server

Map propagation
N IS S la v e S e r v e r

Request to
change passord
(use yppasswd)

NIS Request
Merits of NIS
 Simple, easy to understand. It’s analogous to copying
files around; in most cases, it’s unnecessary for
administrators to be aware of NIS’ internal data formats
 Widely supported by multiple vendors like DEC, HP, SGI.
47

 To be continued

You might also like