SNA Mid Notes
SNA Mid Notes
System and network administration are crucial disciplines in the field of information technology (IT) that
involve managing and maintaining computer systems and networks within an organization. These roles
play a vital role in ensuring the efficient and secure operation of IT infrastructure.
System Administration: System administration focuses on managing and maintaining computer systems,
including hardware, software, and operating systems. System administrators, also known as SAs, are
responsible for tasks such as:
Installing and configuring computer hardware: This involves setting up servers, desktop
computers, laptops, and other hardware components.
Installing and managing operating systems: SAs handle the installation, configuration, and
maintenance of operating systems like Windows, Linux, or macOS on servers and client
machines.
Software management: SAs manage the installation, updates, and licensing of software
applications on systems. They ensure that software runs smoothly and efficiently.
Network management: Although network administration is a separate discipline, SAs are
involved in managing and maintaining network infrastructure to ensure connectivity and proper
integration with systems.
Security management: SAs play a critical role in implementing security measures, such as access
controls, firewalls, antivirus software, and data encryption, to protect systems from
unauthorized access, data breaches, and other security threats.
System monitoring and troubleshooting: SAs monitor system performance, diagnose and resolve
technical issues, and ensure the overall health and stability of the computer systems.
Network design and implementation: NAs plan and design the organization's computer network
infrastructure, including the layout, configuration, and integration of network devices.
Network configuration and management: NAs configure routers, switches, firewalls, and other
network devices to ensure optimal network performance, security, and reliability. They manage
network services like DHCP, DNS, and VPNs.
Network monitoring and troubleshooting: NAs monitor network traffic, analyze performance
metrics, and troubleshoot network issues to ensure uninterrupted network connectivity and
resolve any network-related problems.
Network security: NAs implement and manage network security measures, such as firewalls,
intrusion detection and prevention systems, and virtual private networks (VPNs). They ensure
that the network is protected against unauthorized access and external threats.
Network documentation and planning: NAs maintain accurate documentation of the network
infrastructure, including network diagrams, IP address allocation, and network configurations.
They also plan and execute network upgrades and expansions to meet the organization's
growing needs.
Effective system and network administration requires a combination of technical knowledge, problem-
solving skills, attention to detail, and the ability to adapt to evolving technologies. System administrators
and network administrators often work closely together to ensure the seamless operation and security
of an organization's IT infrastructure.
WEEK 1 Lecture 2
SA stands for System Administrator. A System Administrator is responsible for managing and
maintaining computer systems and networks within an organization. They ensure the smooth operation
of computer systems, servers, and networks, and they play a crucial role in maintaining the overall IT
infrastructure.
SA Components:
Hardware: SAs are responsible for managing and maintaining the hardware components of
computer systems, such as servers, desktop computers, laptops, and peripherals.
Operating Systems: SAs handle the installation, configuration, and maintenance of operating
systems (such as Windows, Linux, or macOS) on servers and client machines.
Software: SAs manage and install software applications on servers and client computers. They
also handle software updates, patches, and licensing.
Networks: SAs are responsible for managing and maintaining the organization's network
infrastructure. This includes tasks like configuring routers, switches, firewalls, and VPNs, as well
as monitoring network performance and troubleshooting network issues.
Security: SAs play a critical role in ensuring the security of computer systems and networks. They
implement security measures like access controls, firewalls, antivirus software, and intrusion
detection systems. They also perform regular security audits and respond to security incidents.
SA Responsibilities:
Installing and configuring computer hardware, operating systems, and software applications.
Monitoring system performance and troubleshooting issues.
Managing user accounts, permissions, and access rights.
Performing data backups and disaster recovery operations.
Managing network infrastructure and ensuring its availability and security.
Conducting system upgrades and patch management.
Developing and implementing IT policies and procedures.
Providing technical support and guidance to end-users.
Ensuring system and data security.
NA stands for Network Administrator. A Network Administrator is responsible for managing and
maintaining an organization's computer networks. They focus specifically on the networking aspects of
IT infrastructure and play a vital role in ensuring the network's availability, performance, and security.
NA Responsibilities:
System Administration Matters: System administration is a crucial aspect of maintaining and managing
computer systems within an organization. It encompasses various tasks related to hardware, software,
operating systems, networks, and security. Effective system administration ensures that IT infrastructure
is functioning optimally, secure, and reliable.
System administrators play a vital role in keeping computer systems up and running, resolving technical
issues, and ensuring data integrity and security. Their responsibilities extend to both the physical and
virtual components of an organization's IT infrastructure.
By contrast, network administrators focus specifically on managing computer networks, including the
configuration, maintenance, and troubleshooting of network devices. They are responsible for
optimizing network performance, ensuring network security, and supporting network connectivity for
users.
Both system administrators and network administrators work closely together, as their roles often
overlap in certain areas. Collaboration between these two roles is essential for maintaining a well
functioning and secure IT environment.
1. Purpose of Building: Determine the purpose and goals of setting up the system. Understand the
specific needs and requirements of the organization, such as improving efficiency, centralizing
data, or enhancing collaboration.
2. Create a Site Map: Develop a site map that outlines the structure and hierarchy of the system.
This will help visualize the different components, modules, and their relationships within the
system.
3. Choosing a Programming Language/Technology: Select a programming language or technology
stack that aligns with the organization's requirements and expertise. Consider factors such as
scalability, security, integration capabilities, and long-term maintenance.
4. Building a Site Layout/Design: Design the layout and user interface of the system. Create
wireframes or mockups to establish the visual structure and user experience. Ensure the design
is intuitive, user-friendly, and visually appealing.
5. Build Your Site Functionality: Develop the system's functionality based on the requirements
identified in the planning phase. Implement features, modules, and integrations necessary to
meet the organization's needs. Follow software development best practices, including modular
design, code documentation, and version control.
6. Testing: Thoroughly test the system to identify and fix any bugs, errors, or usability issues.
Perform functional testing to ensure that all features and functionalities work as intended.
Conduct user acceptance testing (UAT) with representatives from the organization to validate
the system against their specific needs.
7. Deployment/Launch: Prepare the system for deployment by configuring servers, databases, and
network infrastructure. Migrate data from existing systems, if applicable. Set up necessary
security measures, such as access controls and authentication mechanisms. Perform final testing
in the production environment. Once everything is ready, deploy the system to the designated
location and make it accessible to the organization's users.
It's important to note that this process is specifically focused on setting up a system on a location for an
organization, rather than building a website. The steps described here are more applicable to custom
software development or infrastructure setup rather than website development.
It is important to note that moving a data center is a complex process that requires careful planning,
coordination, and testing to minimize disruptions and ensure a successful transition. Engaging
experienced professionals and considering the specific needs and requirements of the organization
are crucial for a smooth data center migration.
Building a data center requires several key components to ensure the efficient and reliable operation of
the facility. Here are some essential components:
Physical Space: A data center requires a dedicated physical space to house the infrastructure.
This space should have sufficient square footage to accommodate servers, racks, networking
equipment, and other necessary components. It should also be designed with proper
ventilation, cooling, fire suppression systems, and environmental controls.
Power Infrastructure: A reliable and robust power infrastructure is critical for a data center. It
includes components such as power distribution units (PDUs), uninterruptible power supplies
(UPS), backup generators, and electrical wiring. Redundancy and backup systems are important
to ensure uninterrupted power supply in case of outages.
Cooling and HVAC Systems: Data centers generate a significant amount of heat, so efficient
cooling systems are essential. This includes computer room air conditioning (CRAC) units,
precision cooling systems, and airflow management solutions. The cooling infrastructure should
be designed to maintain optimal temperature and humidity levels to prevent equipment
overheating.
Networking Infrastructure: A data center requires a robust and scalable networking
infrastructure to facilitate data transmission and connectivity. This includes network switches,
routers, firewalls, and load balancers. The networking components should be designed to
handle high bandwidth requirements and ensure reliable and secure data communication.
Server Racks and Cabinets: Data centers use racks and cabinets to house servers, storage
systems, and networking equipment. These components provide organization, security, and
efficient use of space. They should be designed with cable management systems, proper airflow,
and accessibility for maintenance and upgrades.
Storage Systems: Data centers require storage systems to store and manage data. This can
include storage area networks (SANs), network-attached storage (NAS), or cloud storage
solutions. The storage infrastructure should be scalable, secure, and capable of handling large
amounts of data.
Security Systems: Data centers house valuable and sensitive data, so robust security systems are
crucial. This includes physical security measures like access controls, surveillance cameras,
biometric authentication systems, and secure entry points. Network security measures such as
firewalls, intrusion detection and prevention systems, and data encryption are also essential.
Monitoring and Management Systems: Data centers require monitoring and management
systems to oversee the operation of the infrastructure. This includes environmental monitoring
systems (temperature, humidity), power monitoring systems, server and network monitoring
tools, and centralized management software. These systems help detect and address any issues
promptly and ensure efficient resource allocation.
Backup and Disaster Recovery Solutions: Data centers need backup and disaster recovery
solutions to protect against data loss and ensure business continuity. This includes regular data
backups, redundant storage systems, off-site backups, and disaster recovery plans.
Documentation and Labeling: Proper documentation and labeling of equipment, cables, and
configurations are essential for efficient maintenance, troubleshooting, and scalability. Accurate
documentation ensures easy identification and management of assets within the data center.
It is important to note that the specific components required may vary based on the scale, purpose, and
specific needs of the data center. Designing and implementing a data center should involve
professionals with expertise in data center infrastructure and best practices.
Document Policies
When documenting policies, it's crucial to address various aspects of the organization's operations and
ensure compliance with legal and regulatory requirements. Here are some common policies to consider:
1. Acceptable Use Policy (AUP): The AUP defines acceptable and unacceptable use of the
organization's IT resources, including computers, networks, and internet access. It outlines
guidelines for appropriate behavior, prohibited activities, and consequences for policy
violations.
2. Password Policy: The password policy establishes rules and best practices for creating and
managing passwords. It covers password complexity, length, expiration, and requirements for
regular password updates. The policy may also include guidelines on protecting and securing
passwords.
3. Backup and Recovery Policy: The backup and recovery policy outlines procedures for regular
data backups, storage, and restoration. It defines backup schedules, retention periods, and the
process for testing and verifying backup integrity. The policy should also address disaster
recovery planning and procedures.
4. Network Security Policy: The network security policy sets guidelines and procedures to protect
the organization's network infrastructure and data from unauthorized access, threats, and
vulnerabilities. It includes measures such as firewall configurations, network segmentation,
intrusion detection, and prevention systems, and access controls.
5. Email Policy: The email policy defines rules and guidelines for the appropriate use of the
organization's email systems. It covers email etiquette, confidentiality, spam filtering, email
content, and attachments. The policy may also address archiving and retention of email
communications.
6. Remote Access Policy: The remote access policy provides guidelines and security measures for
employees accessing the organization's network and systems remotely. It covers authentication,
encryption, secure connections, and acceptable remote access methods. The policy should also
address the protection of sensitive data during remote access.
7. Incident Management Policy: The incident management policy outlines procedures for
reporting, handling, and resolving security incidents and breaches. It defines roles and
responsibilities, incident categorization, escalation processes, and communication protocols.
The policy helps ensure timely and effective incident response and mitigation.
8. Software Policy: The software policy establishes guidelines for the acquisition, installation, and
usage of software within the organization. It covers software licensing, authorized software
sources, restrictions on unauthorized software installation, and procedures for software updates
and patches.
It's important to tailor these policies to your organization's specific needs, industry regulations, and legal
requirements. Ensure that policies are communicated, understood, and regularly reviewed and updated
to maintain their effectiveness. Additionally, seek legal and compliance advice when creating or
modifying policies to ensure adherence to relevant laws and regulations.
Microsoft Server Environment: The Microsoft server environment is built around Microsoft Windows
Server operating systems and related technologies. It offers a range of features and tools for managing
and delivering services in a Windows-based server environment. Key components of a Microsoft server
environment include:
Windows Server Operating System: Microsoft offers various editions of Windows Server, such as
Windows Server 2019 and Windows Server 2022. These server operating systems provide a
platform for hosting and managing applications, services, and data.
Active Directory (AD): Active Directory is a directory service provided by Microsoft for managing
and organizing network resources. It enables centralized user management, authentication,
access control, and security policies within a domain network.
Internet Information Services (IIS): IIS is a web server software from Microsoft that allows
hosting and serving web applications and websites. It supports various web protocols, such as
HTTP, HTTPS, and FTP, and provides features like authentication, caching, and load balancing.
Microsoft SQL Server: Microsoft SQL Server is a relational database management system
(RDBMS) that provides robust data storage, management, and analysis capabilities. It is
commonly used in enterprise environments for hosting databases and supporting data-driven
applications.
Microsoft Exchange Server: Exchange Server is a messaging and collaboration platform from
Microsoft. It enables organizations to manage email, calendars, contacts, and other
collaborative services within their network.
Linux Server Environment: The Linux server environment is built on open-source Linux distributions that
offer flexibility, stability, and scalability. Linux-based servers are widely used in various industries due to
their reliability and extensive support from the open-source community. Key components of a Linux
server environment include:
Linux Operating System: Linux is an open-source operating system kernel that forms the
foundation of many Linux distributions. Popular Linux distributions used for server
environments include Ubuntu Server, CentOS, Red Hat Enterprise Linux (RHEL), and Debian.
Apache HTTP Server: Apache is a widely-used open-source web server software that powers a
significant portion of websites on the internet. It provides features such as virtual hosting,
SSL/TLS support, and URL rewriting.
MySQL/MariaDB: MySQL and MariaDB are popular open-source relational database
management systems used in Linux server environments. They provide robust data storage,
management, and retrieval capabilities for various applications.
Nginx: Nginx is a high-performance web server and reverse proxy server that excels at handling
concurrent connections and serving static content. It is commonly used to improve web server
performance and handle high traffic loads.
OpenLDAP: OpenLDAP is an open-source implementation of the Lightweight Directory Access
Protocol (LDAP). It provides a directory service for storing and managing user authentication
information, such as usernames and passwords.
Samba: Samba is a suite of utilities that enables interoperability between Linux/UNIX servers
and Windows clients. It allows Linux servers to act as file servers, print servers, and domain
controllers in Windows-based network environments.
Both Microsoft and Linux server environments have their strengths and are suitable for different use
cases. The choice between them depends on factors such as the organization's requirements, familiarity
with the operating system, compatibility with existing software, and budget considerations.
Remember, server configurations and choices should align with the specific needs and goals of your
organization. Consider consulting with experts or IT professionals to assess your requirements and
make informed decisions regarding server hardware, maintenance, and configurations.
WEEK 3 Lecture 6
Comparative Analysis of most demanded OS:
Important Attributes:
Market Share: Windows has a dominant market share in the desktop and server operating
system market, while Linux is widely used in server environments and has a significant presence
in the cloud and embedded systems.
Cost: Linux is an open-source operating system, meaning it is typically free to use and distribute.
Windows, on the other hand, requires licenses, which can add to the overall cost.
Customizability: Linux offers a high degree of customization and flexibility. As an open-source
OS, it can be modified and tailored to specific needs. Windows, while customizable to some
extent, has limitations due to its proprietary nature.
Support and Documentation: Windows benefits from extensive support and documentation
provided by Microsoft. Linux, being an open-source system, relies on community support, which
is often robust and comprehensive. Additionally, commercial Linux distributions offer paid
support options.
Key Features:
Windows:
User-Friendly Interface: Windows provides a familiar and user-friendly graphical user interface
(GUI) that is easy to navigate.
Wide Software Compatibility: Windows has a vast range of software applications and games
developed specifically for the platform.
Active Directory: Windows Server includes Active Directory, a robust directory service for
managing network resources and user authentication.
Microsoft Office Suite: Windows integrates well with the Microsoft Office suite, a popular
productivity toolset.
Linux:
Stability and Reliability: Linux is known for its stability and reliability, often running for extended
periods without requiring reboots.
Security: Linux is generally considered more secure than Windows due to its architecture and
strong focus on user privileges and permissions.
Customizability: Linux offers a wide range of distributions and allows customization to suit
specific needs, making it highly adaptable.
Command-Line Interface (CLI): Linux provides a powerful command-line interface, allowing
administrators fine-grained control and automation capabilities.
Pros and Cons:
Windows:
Pros:
Wide range of software compatibility and support for commercial applications.
Extensive hardware support and ease of use for non-technical users.
Strong integration with Microsoft products and services.
Robust support and documentation provided by Microsoft.
Cons:
Cost associated with licensing and proprietary software.
More susceptible to malware and security threats compared to Linux.
Limited customization options and less flexibility for advanced users.
Frequent updates and reboots can disrupt operations.
Linux:
Pros:
Open-source nature allows customization and flexibility.
Strong emphasis on security and stability.
Vast software repository and package managers for easy software installation and updates.
Cost-effective, as most Linux distributions are free to use.
Cons:
Steeper learning curve, especially for users accustomed to a Windows environment.
Hardware support may vary depending on the distribution.
Limited support for certain proprietary software or games.
Reliance on community support, which may vary in responsiveness and expertise.
Understanding the Differences:
Windows and Linux have distinct characteristics and cater to different user requirements. Windows
excels in providing a user-friendly interface, broad software compatibility, and extensive support from
Microsoft. It is widely used in desktop environments and offers robust server solutions with Active
Directory integration.
Linux, on the other hand, offers customization, stability, security, and a vast array of distributions to
choose from. It is popular in server environments, especially for web servers and cloud infrastructure.
Linux provides strong command-line capabilities, flexibility for advanced users, and cost-effectiveness
due to its open-source nature.
The choice between Windows and Linux depends on factors such as specific use case, hardware
compatibility, software requirements, user expertise, and budget considerations. Organizations often
evaluate their needs and assess the strengths and weaknesses of each platform to make an informed
decision. In some cases, a hybrid approach may be adopted, leveraging the strengths of both operating
systems in a mixed.
WEEK 4 Lecture 7
Linux Installation and Verification:
Methods of Installation: There are several methods to install Linux, including:
Installation from Physical Media: This involves booting the computer from a CD/DVD or USB
drive containing the Linux distribution and following the installation wizard.
Network-Based Installation: This method involves booting the system from a network boot
server and installing Linux over the network.
Virtual Machine Installation: Linux can be installed as a guest operating system within a virtual
machine environment using software like VirtualBox or VMware.
Installing Linux Server: To install Linux server, follow these general steps:
Choose the Linux distribution that suits your needs, such as Ubuntu Server, CentOS, or Debian.
Download the installation ISO file from the distribution's official website.
Create installation media (CD/DVD or USB) using the ISO file.
Boot the server from the installation media and follow the on-screen prompts to begin the
installation process.
Select the desired installation options, such as language, keyboard layout, and partitioning.
Configure network settings, set the server's hostname, and create user accounts.
Choose the software packages and services to be installed. For a server, select packages relevant
to your intended use, such as web server software (e.g., Apache), database servers (e.g.,
MySQL), or security tools.
Complete the installation process, reboot the server, and log in to the newly installed Linux
server.
Initial System Configuration: After installing Linux, perform the following initial system
configuration:
Update Packages: Run package management commands (e.g., apt-get update and apt-get
upgrade on Ubuntu) to update the installed software packages to the latest versions.
Secure the System: Configure firewall rules, disable unnecessary services, and set up security
measures like strong passwords and SSH key-based authentication.
Set Timezone: Set the correct timezone for the server using the appropriate command or
configuration file.
Configuring the Network: To configure the network in Linux, follow
these steps:
Identify Network Interface: Use the command ifconfig or ip addr show to list the
available network interfaces.
Configure Network Interface: Modify the network interface configuration file (e.g.,
/etc/network/interfaces on Debian-based systems) or use tools like nmtui or nmcli to
set the IP address, netmask, gateway, and DNS servers.
Restart Network Service: Restart the network service or reboot the server for the changes to
take effect.
Remember that specific commands, tools, and configuration files may vary depending on the Linux
distribution you are using. It's essential to consult the documentation and resources specific to your
chosen distribution for detailed instructions and guidelines on system configuration and management.
WEEK 4 Lecture 8
Managing Linux Files, Directories, and Archives:
Links:
Symbolic Links: Symbolic links, also known as soft links, are pointers to files or directories. They
can be created using the ln command with the -s option.
Hard Links: Hard links are additional names (links) for an existing file. Unlike symbolic links, hard
links directly reference the same inode as the original file. Use the ln command without any
options to create hard links.
Inode:
Inode: An inode is a data structure in Linux that stores metadata about a file, such as
permissions, ownership, timestamps, and file size. Each file or directory on a Linux filesystem
has an associated inode.
Inode Table: The inode table is a data structure that stores information about all the inodes on a
filesystem. It is typically stored in a reserved area of the filesystem.
cp and Inode: When you copy a file using the cp command, a new file with a new inode is
created.
mv and Inode: When you move a file using the mv command within the same filesystem, the file
retains the same inode.
rm and Inode: When you delete a file using the rm command, the associated inode is marked as
available, and the file's data blocks are freed.
Archives Files:
tar: The tar command is used to create archives (tarballs) that can contain multiple files and
directories. It does not compress the files by default.
Compressing Archives: To compress archives created with tar, you can use various compression
tools such as gzip, bzip2, or zip.
File Compression:
gzip: The gzip command is used to compress files using the GNU zip compression algorithm.
Compressed files typically have the .gz extension.
bzip2: The bzip2 command is used to compress files using the Burrows-Wheeler block sorting
compression algorithm. Compressed files typically have the .bz2 extension.
zip: The zip command is used to create and extract ZIP archives, which can contain multiple files
and directories. ZIP is a popular compression format widely supported on various operating
systems.
These are some of the essential commands and concepts related to managing files, directories, and
archives in Linux. There are additional options and features available for each command, so refer to the
respective command's manual pages (man command) for detailed usage instructions and options.
WEEK 4 Lecture 9
Administering Users and Groups:
Essentials: Concept of Users & Groups: In Linux, users and groups are fundamental concepts for
access control and resource management.
Users: Each individual who interacts with the system is assigned a unique user account. User
accounts define the user's identity, permissions, and resources.
Groups: Groups are collections of user accounts. They allow administrators to assign common
permissions and access privileges to a set of users. A user can belong to multiple groups.
User Account Management: User account management involves creating, modifying, and
deleting user accounts.
Creating User Accounts: Use the useradd command to create a new user account. Additional
user details like home directory, default shell, and group membership can be specified.
Modifying User Accounts: The usermod command allows you to modify user account attributes
such as the username, home directory, default shell, group membership, and more.
Deleting User Accounts: The userdel command is used to delete user accounts. By default, it
removes the user's home directory as well. Use the -r option to remove the home directory
recursively.
Password Management: Password management involves setting and modifying user account
passwords.
Setting Passwords: The passwd command is used to set passwords for user accounts.
Administrators can set initial passwords or force password changes for users.
Password Policy: Password policies can be enforced to ensure strong and secure passwords.
Policies may include minimum length, complexity requirements, password expiration, and more.
Group Management: Group management involves creating, modifying, and deleting groups.
Creating Groups: Use the groupadd command to create a new group. Group details such as the
GID (Group ID) can be specified.
Modifying Groups: The groupmod command allows you to modify group attributes such as the
group name or GID.
Deleting Groups: The groupdel command is used to delete groups. Note that a group cannot be
deleted if it still has users associated with it.
Configuring a Co-Administrator - The sudo Utility: The sudo utility allows authorized users to run
commands with administrative privileges temporarily. It enables fine-grained control over user
access to system resources.
Granting sudo Access: Administrators can grant sudo access to specific users or groups by
configuring the /etc/sudoers file using the visudo command.
User Management Tools: Linux provides several user management tools with graphical
interfaces, such as:
useradd: Command-line tool for adding user accounts.
usermod: Command-line tool for modifying user accounts.
userdel: Command-line tool for deleting user accounts.
passwd: Command-line tool for managing passwords.
Graphical User Interface (GUI) tools: Examples include Users and Groups on Ubuntu or system-
config-users on CentOS.
Users and Access Permissions: Managing access permissions is crucial for controlling user
privileges and securing the system.
File and Directory Permissions: Linux employs permission bits (read, write, execute) for files and
directories, granting or restricting access to users and groups.
Access Control Lists (ACLs): ACLs provide a more granular approach to manage access
permissions, allowing for additional access rules beyond the basic permission bits.
Role-Based Access Control (RBAC): RBAC enables administrators to assign permissions based on
roles, simplifying access management for large systems with multiple users and groups.
These concepts and tools help administrators effectively administer users and groups, control access to
resources, and maintain system security in a Linux environment.
WEEK 5 Lecture 10
Managing Users in Linux:
/etc/passwd: This file contains user account information, such as usernames, user IDs (UIDs),
default shell, and home directories. It is readable by all users.
/etc/group: The group file stores group information, including group names and group IDs
(GIDs). It specifies which users belong to each group.
/etc/shadow: The shadow file stores encrypted passwords and password aging information. It is
only readable by the root user.
/etc/gshadow: The gshadow file contains shadowed group passwords and additional group
information. Similar to /etc/shadow, it is only accessible by the root user.
User Accounts:
User accounts are created and managed using various tools and commands in Linux:
User Management Tools: Linux distributions provide user management tools with graphical
interfaces, such as Users and Groups on Ubuntu or system-config-users on CentOS. These tools
simplify user administration tasks.
Command-Line Tools: Common command-line tools for managing users include useradd,
usermod, and userdel. These commands allow you to add, modify, and delete user accounts,
respectively.
To modify user account attributes, such as the home directory or default shell, you can use the
usermod command. For example: usermod -d /home/newhome john.
To remove a user account, use the userdel command followed by the username. For example:
userdel john.
Vi Editor:
Vi is a powerful text editor commonly found on Linux systems. It has three primary modes:
command mode, insert mode, and last line mode.
Starting Vi: Open a file with Vi by typing vi filename in the terminal. If the file doesn't exist, Vi
creates a new file with that name.
Modes of Vi:
Command Mode: The default mode in Vi. Allows you to execute commands such as navigation,
editing, and saving.
Insert Mode: Used for entering and editing text.
Last Line Mode: Accessed by pressing : in command mode. Used for entering commands that
affect the whole file or specify options.
Cursor Movement: In command mode, use the arrow keys, h, j, k, and l to move the cursor left,
down, up, and right, respectively.
Entering Insert Mode: Press i in command mode to enter insert mode. You can start typing or
editing the text.
Leaving Insert Mode: Press the Esc key to exit insert mode and return to command mode.
Change, Delete, and Yank: In command mode, use commands like c, d, and y combined with
movement commands to change, delete, or yank (copy) text.
Paste: In command mode, use the p command to paste the previously yanked or deleted text.
Undo Changing: Press u in command mode to undo the most recent change.
Searching for Text: In command mode, use the / command followed by the text to search
forward, or ? followed by the text to search backward.
Saving and Exiting: In command mode, use :w to save the file and :q to quit Vi. To save and quit
simultaneously, use :wq.
Nano Editor:
Nano is a beginner-friendly text editor available on many Linux distributions. It provides a more
straightforward interface compared to Vi.
Starting Nano: Open a file with Nano by typing nano filename in the terminal. If the file doesn't
exist, Nano creates a new file with that name.
Editor Interface: Nano provides an easy-to-use interface with menus and shortcut keys displayed
at the bottom of the screen. Use the arrow keys to navigate within the file.
Command Mode: The default mode in Nano. Use shortcut keys to access various commands and
functions.
Insert Mode: Used for entering and editing text.
Search/Replace Mode: Accessed by pressing Ctrl + W to search for text or Ctrl + \ to search and
replace text.
Cursor Movement: Use the arrow keys to move the cursor within the file.
Entering Insert Mode: Nano starts in command mode. Press Ctrl + G to access the help menu,
which displays available commands. Press Ctrl + O to enter insert mode and start editing the file.
Leaving Insert Mode: Press Ctrl + X to exit insert mode and return to command mode.
Change, Delete, and Yank: In command mode, use the available shortcut keys to perform actions
such as cutting, copying, pasting, and deleting text.
Paste: In command mode, use the Ctrl + U shortcut key to paste the previously cut or copied
text.
Undo Changing: Press Ctrl + _ (underscore) to undo the most recent change.
Searching for Text: In command mode, press Ctrl + W to enter search mode. Enter the text to
search and navigate through search results using the available options.
Saving and Exiting: In command mode, press Ctrl + X to exit Nano. If any changes were made,
Nano prompts to save the file before exiting.
Both Vi and Nano are popular text editors in Linux. Vi is known for its extensive capabilities and
flexibility, while Nano provides a more user-friendly and intuitive interface, making it suitable for
beginners or those who prefer a simpler editing experience.
WEEK 6 Lecture 11
Software Management:
Package Manager: A package manager is a software tool used in Linux systems to handle the installation,
removal, and management of software packages. It simplifies the process of installing and maintaining
software by resolving dependencies and automating various tasks.
Common package managers in Linux distributions include:
Advanced Package Tool (APT): Used in Debian-based distributions like Ubuntu. It includes
commands such as apt-get, apt-cache, and aptitude.
Yellowdog Updater, Modified (YUM): Used in Red Hat-based distributions like CentOS. It
includes commands such as yum install, yum remove, and yum update.
PackageKit: A high-level package management abstraction layer used in various Linux
distributions. It provides a consistent interface to interact with different package managers.
Adding and Removing Packages: To add or install packages using a package manager, you
typically use the appropriate command along with the package name.
With YUM:
Installing a package: sudo yum install package_name
Removing a package: sudo yum remove package_name
Identifying Installed Packages: To identify the packages installed on your system, you can use
the package manager's command-line options:
With APT:
Listing installed packages: dpkg --list
With YUM:
Listing installed packages: yum list installed
Update Packages: To update installed packages to their latest versions, you can use the package
manager's update command:
With APT:
Updating packages: sudo apt-get update followed by sudo apt-get upgrade
With YUM:
Updating packages: sudo yum update
Querying and Verifying Packages: You can query and verify packages using package manager commands:
With APT:
Querying package information: apt-cache show package_name
With YUM:
Querying package information: yum info package_name
Extract the contents of the compressed archive using the tar command: tar -xzf
archive_name.[Link]
Navigate to the extracted directory: cd extracted_directory
Read the provided documentation or instructions for installation. Typically, you'll find a README
or INSTALL file with instructions specific to the software.
Follow the installation instructions, which usually involve running configuration scripts,
compiling code, and installing dependencies.
Once the installation steps are completed, you can use the software as instructed.
Note: Installing software from compressed archives may have different procedures depending on the
specific software being installed. Always refer to the documentation or instructions provided by the
software developers for accurate installation steps.
Package managers are generally recommended for software installation as they handle dependencies,
versioning, and updates more efficiently. However, installing software from compressed archives can be
useful for specific cases where packages are not available in the package manager's repositories.
WEEK 6 Lecture 12
Managing Network Services and Network Monitoring Tools:
Linux Networking Environment: Linux provides a robust networking environment with various
features and tools for configuring and managing network services.
Networking Features of Linux: Linux supports a wide range of networking features, including:
IP addressing: Linux supports both IPv4 and IPv6 addressing schemes.
Routing: Linux can handle routing packets between different networks and configure routing
tables.
Network Address Translation (NAT): Linux can perform NAT to translate private IP addresses to
public ones, allowing multiple devices to share a single public IP.
Firewalling: Linux has built-in firewall capabilities, such as iptables or nftables, to filter network
traffic based on rules.
Virtual Private Networks (VPNs): Linux supports various VPN protocols like OpenVPN and IPsec
for secure remote access.
Identify the NIC: Use the ip link or ifconfig -a command to list available network interfaces.
Activate the NIC: Use the ip link set interface up or ifconfig interface up command to activate
the network interface.
Configure IP address: Use the ip addr add address/prefix dev interface or ifconfig interface
address/prefix command to assign an IP address to the interface.
Setting Gateway: To set the default gateway in Linux, you can use the ip route command. Here's
an example:
ip route add default via gateway_ip dev interface
Replace gateway_ip with the IP address of the gateway router and interface with the network interface
connected to the gateway.
IP Forwarding: IP forwarding allows Linux to act as a router by forwarding packets between different
networks. To enable IP forwarding, you can set the value of the /proc/sys/net/ipv4/ip_forward file to 1.
Use the following command:
To make the change persistent across reboots, modify the /etc/[Link] file and set
net.ipv4.ip_forward to 1.
These commands allow you to manage routes, specify the network and subnet, the gateway for routing
packets, and the network interface associated with the route.
Network monitoring tools: Linux provides various network monitoring tools to track network
activity, troubleshoot issues, and gather performance metrics. Some popular tools include:
ping: Checks network connectivity and measures round-trip time to a destination.
netstat: Displays active network connections, listening ports, and network statistics.
tcpdump: Captures and analyzes network traffic in real-time.
nmap: Scans and maps network hosts, identifying open ports and services.
iftop: Monitors network bandwidth usage on specific interfaces.
wireshark: Captures and analyzes network packets, providing detailed protocol-level analysis.
These tools help administrators monitor network performance, identify network issues, and analyze
network traffic for troubleshooting purposes.
WEEK 7 Lecture 13
Boot Management and Process Management:
Boot Loaders: Boot loaders are software programs that are responsible for loading the operating system
into memory during the boot process. Two common boot loaders used in Linux are:
1. GRUB (GRand Unified Bootloader): GRUB is the default boot loader for most Linux distributions.
It provides a menu that allows the user to select the operating system to boot. GRUB supports
various configurations and can handle different file systems.
2. LILO (LInux LOader): LILO is an older boot loader that is still used in some legacy systems. Unlike
GRUB, LILO does not provide a menu interface and requires manual configuration of the boot
loader settings.
Bootstrapping:
Bootstrapping is the process of initializing the system and loading the operating system into memory
during the boot process. It involves the following steps:
Power-on: The system is powered on, and the firmware (such as BIOS or UEFI) performs initial hardware
checks.
1. Boot loader: The boot loader is loaded into memory and takes control of the boot process.
2. Kernel loading: The boot loader locates and loads the kernel image into memory.
3. Kernel initialization: The kernel initializes the essential system components, such as memory
management, device drivers, and the root file system.
4. Init process: The kernel starts the init process, which is the first process that runs in the system
and is responsible for launching other processes and services.
5. Enabling and Disabling Services: In Linux, services are background processes that provide
specific functionality to the system.
To enable or disable services, you can use the service management tool provided by the init system used
in your distribution.
Enabling a service ensures that it starts automatically during system boot, while disabling a service
prevents it from starting automatically. It gives you control over which services are running on your
system and can help optimize resource usage.
Proper management of boot loaders, bootstrapping, and service management is crucial for ensuring a
stable and efficient Linux system.
WEEK 7 Lecture 14
IP Tables and Filtering:
IP Tables Basics: iptables is a user-space utility in Linux that allows administrators to configure and
manage the netfilter firewall system. It provides a flexible framework for filtering and manipulating
network packets.
Filtering: IP tables can filter packets based on various criteria such as source/destination IP address,
port numbers, protocols, and packet states (established, related, new).
Network Address Translation (NAT): IP tables can perform NAT to modify source or destination IP
addresses and ports, enabling masquerading or port forwarding.
Adding and Deleting Rules: To add and delete rules in iptables, you use the command-line interface.
Here are some examples:
Adding a rule to allow incoming SSH connections: sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Deleting a rule to block outgoing HTTP connections: sudo iptables -D OUTPUT -p tcp --dport 80 -j
DROP
Rules can be added or deleted from specific chains (such as INPUT, OUTPUT, or FORWARD) based on the
desired network traffic behavior.
How Netfilter Works: Netfilter is the packet filtering framework in the Linux kernel that processes
network packets. It consists of several components:
Hooks: Netfilter provides hooks at different stages of packet processing, allowing administrators to
define rules and actions for each stage.
Tables: Netfilter organizes rules into different tables based on packet type or purpose. Common
tables include filter, nat, and mangle.
Chains: Each table consists of chains, which define specific packet traversal paths. Examples include
INPUT, OUTPUT, and FORWARD.
Rules: Rules define the actions to be taken on packets that match specific criteria. Rules can accept,
drop, or modify packets.
Connection Tracking and NAT: Netfilter includes connection tracking functionality, which maintains
information about network connections. It allows iptables to handle related and established connections
more efficiently.
NAT is another key feature of Netfilter. It allows you to modify the source and/or destination addresses
and ports of packets, enabling tasks like network address translation, port forwarding, or load balancing.
Installing Netfilter: Netfilter is a part of the Linux kernel and is typically available by default in most Linux
distributions. It does not require separate installation.
Enabling Netfilter in the Kernel: Netfilter support is enabled by default in the Linux kernel. However, to
utilize specific features or modules, you may need to ensure the necessary kernel modules are loaded.
This can typically be done by configuring the kernel or using the appropriate kernel modules.
Configuring Netfilter: Netfilter configuration is done through iptables, which provides a command-line
interface to manage the firewall rules.
The iptables Command: The iptables command is used to configure and manage firewall rules. It
provides a wide range of options to add, delete, and modify rules, as well as view the current rule set.
Linux Firewall: The Linux firewall, implemented using iptables and Netfilter, allows you to define rules to
control network traffic. By configuring the firewall rules, you can restrict incoming and outgoing
connections, set up port forwarding, and implement other security measures to protect your system.
It's important to carefully plan and configure firewall rules to ensure the desired network traffic
behavior while maintaining the security and accessibility of the system.
WEEK 8 Lecture 15
Advanced File Systems:
Which File System to Use? The choice of file system depends on various factors such as the specific use
case, performance requirements, scalability, reliability, and compatibility with the operating system.
Here are some commonly used file systems in Linux:
ext2 (Second Extended File System): It is one of the earliest file systems used in Linux. It provides
basic file system features but lacks journaling, which can result in slower file system checks after
crashes.
ext3 (Third Extended File System): ext3 is an extension of ext2 that adds journaling, improving
reliability and faster recovery after system crashes.
ext4 (Fourth Extended File System): ext4 is the successor to ext3 and offers improved performance,
scalability, and reliability. It supports larger file sizes and larger volumes compared to ext3.
jfs (Journaled File System): jfs is a high-performance file system with journaling capabilities. It
provides good scalability and supports large files and volumes.
ReiserFS: ReiserFS is a journaling file system known for its efficient handling of small files and
directories. However, its usage has declined in recent years.
XFS: XFS is a high-performance, scalable file system designed for large-scale storage systems. It
supports extensive parallelism and can handle large files and volumes efficiently.
Btrfs (B-Tree File System): Btrfs is a modern file system that offers features like snapshotting,
transparent compression, and RAID support. It is designed for scalability, fault tolerance, and ease of
administration.
Managing File Systems: To manage file systems in Linux, you can use various commands and utilities.
Here are some common tasks:
Creating a file system: You can create a file system on a partition or disk using the mkfs command,
followed by the appropriate file system type and device name.
Mounting a file system: The mount command is used to mount a file system to a specific directory in
the Linux file hierarchy, making its contents accessible.
Checking file system integrity: The fsck command allows you to check and repair the integrity of a
file system. It can detect and fix errors to ensure the file system remains consistent.
Resizing file systems: If you need to resize a file system, you can use tools like resize2fs (for
ext2/3/4) or xfs_growfs (for XFS) to resize the file system to utilize additional space.
It's important to choose the appropriate file system based on your requirements and consider factors
such as performance, reliability, and compatibility. Regular maintenance and monitoring of file systems
are also important to ensure their optimal functioning and prevent data loss.