Network System Administration: Assosa University College of Computing & Informatics
Network System Administration: Assosa University College of Computing & Informatics
Compiled by Kemal H.
Chapter One
Introduction to System and Network Administration
What is a System Administrator?
Source: Unknown
System Administration Tasks
❏ User Management
❏ Hardware Management
❏ Software Management
❏ Backups
❏ Firefighting!!!
The Good…
❏ Lots of variety
❏ Challenging
❏ Fulfilling
❏ Pays well
❏ Very employable
The Bad…
❏ Annoying at times
❏ Users
❏ Management
❏ Long hours
• Some of the Bell Labs programmers who had worked on this project, Ken
Thompson, Dennis Ritchie, Rudd Canaday, and Doug McIlroy designed
and implemented the first version of the Unix File System on a PDP-7
along with a few utilities. It was given the name UNIX by Brian
Kernighan.
• 00:00:00 Hours, Jan 1, 1970 is time zero for UNIX. It is also called as
epoch.
Introduction to Linux
…Cont’d
In addition to these
distributions, there are
many other options
available, each with its
own unique features and
focus. The UIs available
on Linux include
GNOME, KDE, Xfce,
LXDE, and others.
Linux Operations Review
➔ File system navigation: move from one directory to another directory (cd)
➔ File management: creating, copying, moving, and deleting files.
➔ Package management: install, update, and remove software packages
➔ Process management: managing processes, such as "ps" to list
running processes, "kill" to terminate a process
➔ User management:creation and management of user accounts
➔ Networking:Linux offers a range of networking commands for configuring
network settings, such as "ifconfig" to display network interface
information
File system Hierarchy and Standard
The File system Hierarchy Standard (FHS) is a standard that defines the structure of the file system on
Linux and other Unix-like operating systems.
★ Here is a brief overview of the file system hierarchy and standard in Linux:
1. / (root): The root directory of the file system, which contains all other directories and files.
2. /bin: Contains executable files that are necessary for the system to function, such as basic system
utilities like "ls", "cd", and "cp".
3. /etc: Contains system configuration files, such as configuration files for networking, users, and system
services.
4. /home: Contains user home directories, which are used to store user-specific files and configuration
settings.
5. /dev: Contains device files, which are used to represent hardware devices in the system.
6. /proc: Contains virtual files that provide information about system resources, such as memory usage
and CPU usage.
Single-rooted hierarchy
● A single-rooted hierarchy is a type of file system hierarchy in which all
directories and files are arranged in a tree-like structure with a single root
directory.
● This means that all files and directories can be accessed relative to the root
directory
● Unix/Linux file systems are a good example of a single-rooted hierarchy.
Seamless file systems
● file systems that integrate multiple physical or virtual storage devices into a
single logical file system.
● This allows users to access data stored on different devices as if they were
stored in a single location, without needing to know the details of the
underlying storage architecture.
● Some examples of seamless file systems include Distributed File System
(DFS) and GlusterFS.
extensible file system
● a file system that can be extended or modified without requiring significant
changes to the underlying file system architecture.
● This allows the file system to adapt to changing storage requirements and
accommodate new features or technologies.
● One example of an extensible file system is the Extended File System (ext)
used by many Linux distributions.
Some examples of file system standards
● File Allocation Table (FAT): A file system standard
● used by many older versions of Windows and
DOS.
● New Technology File System (NTFS): A file system standard used by modern versions of
Windows.
● Extended File System (ext): A file system standard used by many Linux distributions.
● Universal Disk Format (UDF): A file system standard used for optical media such as DVDs and
Blu-ray discs.
● Hierarchical File System (HFS): A file system standard used by macOS.
● Apple File System (APFS): A file system standard used by modern versions of macOS and iOS.
● Network File System (NFS): A file system standard used for sharing files between computers on a
network.
● Common Internet File System (CIFS): A file system standard used for sharing files between
computers on a network, primarily in Windows environments.
Essential Shell Commands
❏ Here are some essential shell commands that are commonly used:
❏ cd: Change directory. Used to navigate the file system by changing the current working
directory.
❏ ls: List files. Used to display the contents of a directory, including files and subdirectories.
❏ mkdir: Make directory. Used to create a new directory.
❏ rmdir: Remove directory. Used to delete an empty directory.
❏ rm: Remove. Used to delete a file or directory (with the "-r" option).
❏ cp: Copy. Used to copy files or directories.
❏ mv: Move. Used to move files or directories.
❏ cat: Concatenate. Used to display the contents of a file
❏ echo: Used to display a message on the screen or to redirect output to a file.
…cont’d
❏ pwd: Print working directory. Used to display the current working
directory.
❏ ps: Process status. Used to display information about running processes.
❏ top: Used to display real-time information about system processes.
❏ sudo: Superuser do. Used to execute commands with administrative
privileges.
❏ ssh: Secure shell, used to connect to remote system over a secure
network connection
❏ tar: Tape archive. Used to create and extract compressed archive files.
Advanced Shell Features
Shell scripting is a powerful tool for automating tasks on Linux and other Unix-like
systems.
Here are some advanced shell features that can help users create more powerful
and efficient shell scripts:
★ Variables: Variables are used to store values that can be used later in a
script. Variables can be set using the "=" operator, such as "name=John". To
use the value of a variable, it can be referenced by using "$" followed by the
variable name, such as "$name".
…cont’d
● Input/output redirection: Input/output redirection allows users to redirect the
input or output of a command to a file or another command. The ">" operator
is used to redirect the output of a command to a file, while the "<" operator is
used to redirect the input of a command from a file. For example: "ls > file.txt".
● These are just a few of the many advanced shell features that are available on
Linux and other Unix-like systems. By mastering these features, users can
create powerful and efficient shell scripts to automate tasks and improve their
workflow.
Chapter Two
Account and Security Administration
User and Group
In Linux and other Unix-like systems, users and groups are used to manage access to
system resources such as files and directories.
❏ Users: A user is a person who accesses the system and performs tasks.
➢ Each user is identified by a unique username and has their own home
directory, which is used to store their personal files and configurations.
❏ Groups: A group is a collection of users who share common permissions and
access to system resources.
➢ Each group is identified by a unique group name and has a group ID (GID).
User Private Group Scheme
❏ The User Private Group (UPG) scheme is a security model used in Linux
and other Unix-like systems to provide each user with their own private group.
❏ Under this scheme, when a new user is created, a new group is also created
with the same name as the user and the user is added to that group.
❏ This ensures that each user has their own private group and that their files
and directories are not accessible by other users by default.
User and Group Administration
❏ In Linux and other Unix-like systems, user administration and group administration are
important tasks that system administrators perform to manage users and groups.
adduser: create new user account. eg. sudo adduser cs. After this command we
will fill like password, full name and so on..
Optional
userdel/deluser:
passwd: to change password. Sudo passwd cs
Delete user account
Usermod:
Modify user account
eg . change username, adduser to
another group etc..
username
groupmod : used to modify group account eg. rename group sysadmin to cstutorial
◆ Password expiration: Password expiration is the process of forcing users to change their
● This can be configured using the "chage" command, which sets the password expiry
Default file
Directory file Regular file (none folder files like .txt, .ppt, .docx, .sh )
…Cont’d
2. Folder permissions: are used to control access to directories and the files they
contain.
The first rwx is for owner of the folder, the second r-x is for group and the third r-x for guest
…Cont’d
❏ The chmod command is the most commonly used command for managing file and folder
permissions.
❏ It can be used to add or remove permissions, set permissions for the owner, group, or
other users, and set permissions using numeric or symbolic modes.
❏ Numeric mode: from 0 to 7
❏ Symbolic mode: r w x
Managing File Ownership
❖ system administrators need to perform to ensure system security and control
access to system resources.
❖ Here is an overview of how to manage file ownership:
➢ File ownership: File ownership refers to the user and group that are associated with a file.
➢ Managing file ownership: The following are some of the key commands used to manage file
ownership:
■ chown: Used to change the owner of a file or folder.
■ chgrp: Used to change the group of a file or folder.
The chown and chgrp commands are used to change the ownership of a file or folder. The syntax of the
commands is as follows: (next slide)
…cont’d
General Syntax:
➔ The first command changes the owner of
the file to the specified user,
➔ while the second command changes both
OR
the owner and the group of the file to the
specified user and group.
To give full permission(read, write and execute) for user kemal to file a.txt
For further example, you can get the writing syntax of ACLs
Setfacl --help
Quiz(3%)
1. Write linux command to give read only permission for user john to file1.txt using ACLs
…Cont’d
To view ACLs
Managing Disk Quotas
❏ disk quotas are used to limit the amount of disk space that users and groups
can use on a file system.
❏ This is an important feature for system administrators who need to manage
disk space usage and prevent users from filling up the file system.
A. Enabling disk quotas: Disk quotas must be enabled on a file system before they can be used
This is typically done by editing the file system /etc/fstab file and adding the usrquota and/or
grpquota options to the mount options for the file system. For example:
This line enables user and group quotas on the /home file system
…Cont’d
B. Setting up quotas: Once disk quotas are enabled, quotas must be set up for individual users or
groups. This is done using the edquota command. The syntax of the command is as follows:
OR
…Cont’d
C. Monitoring quotas: Once quotas are set up, they can be monitored using the quota command.
The syntax of the command is as follows:
OR
This command displays the current disk usage and quota limits for the specified user or
group.
…Cont’d
D. Adjusting quotas: Quotas can be adjusted using the edquota command. The administrator can
edit the quota configuration file for a user or group to increase or decrease their quota limits.
● fdisk is a command-line utility for partitioning disks on Linux systems. Here's how you can use it to partition a disk:
○ Step1 Open terminal
○ Step3 fdisk will display a warning message about potentially destructive actions. Press "n" to create a new partition.
○ Step4 Follow the prompts to specify the partition type, starting and ending sectors, and other details about the new
partition.
○ Step5 Repeat the process to create additional partitions as needed.
○ Step6 Once you have created all of the partitions you need, press "w" to write the changes to disk and exit fdisk.
..Cont’d
1. Open a terminal window and log in as the root user or use the sudo command to run parted with root privileges.
2. Type "parted /dev/sdX" to start parted, where "X" is the letter corresponding to the disk you want to partition. For
example, if you want to partition the first hard disk in the system, you would use "parted /dev/sda".\
4. Once you have created all of the partitions you need, use the "quit" command to exit parted.
…Cont’d
Newly created
partition
..Cont’d
To delete partition
Open Terminal
sudo fdisk /dev/sdx where x is partition name eg. /dev/sda
Enter d to delete partition
Enter partition number eg. if partition is at /dev/sda1 Enter 1
Enter w to write on the disk
quit
mkfs.ext4 /dev/sda1
…Cont’d
● Both fdisk and parted are powerful tools for partitioning disks, and can be used to
create complex partition layouts with multiple partitions of different types and sizes.
It's important to be careful when using these tools, as errors or mistakes can result in
data loss or other problems. Be sure to backup important data before making any
changes to disk partitions.
Creating a file system
● To create a new file system on a disk partition, you can use the mkfs
command followed by the type of file system you want to create (e.g., ext4,
xfs, btrfs, etc.) and the name of the partition you want to format.
This command will format the first partition on the first hard disk in the system with
the ext4 file system.
Mounting a file system
● To mount a file system, you first need to create a mount point (i.e., a directory
where the file system will be accessible). You can use the mkdir command to
create a new directory for this purpose.
Maintaining a file system
● To maintain a file system, there are several tools and commands available on
Linux systems.
• df: displays information about disk usage and available space on file systems
• du: displays information about disk usage of files and directories
• fsck: checks and repairs file system errors
• tune2fs: allows you to tune various parameters of an ext2, ext3, or ext4 file system
• xfs_repair: checks and repairs XFS file systems
…Cont’d
2. Use a partitioning tool like fdisk or parted to create a new partition on your hard drive.
Make sure to set the partition type to "Linux swap" (type code 82).
3. Format the new partition with the mkswap command.
…Cont’d
To make the swap partition persistent across reboots, add an entry for it in the /etc/fstab file.
Determining disk usage with du and df
● du: used to estimate the space used by file and directories.
● df: used to display the amount of disk space available on file systems.
In the fstab file, the number 2 specifies the order in which file systems are
checked for errors at boot time.
Logical volume management and RAID
❏ Logical Volume Management (LVM) and Redundant Array of Independent
Disks (RAID) are two technologies that can help manage and protect data on
Linux systems.
❏ Logical Volume Management (LVM)
❏ LVM is a technology that allows you to create logical volumes from multiple physical
volumes (such as hard drives or partitions), and manage them as a single, flexible
storage pool.
❏ With LVM, you can easily resize volumes, add or remove physical storage, and take
snapshots of volumes for backups or testing purposes.
Redundant Array of Independent Disks (RAID)