0% found this document useful (0 votes)
3 views

Linux--Notes

The document provides a comprehensive guide to Linux, covering topics such as open-source software, command-line interface commands, installation processes, user administration, disk quotas, network configuration, and various network services. It includes detailed explanations of file management, shell commands, package management, and server configurations for DNS, DHCP, FTP, and NFS. Each section outlines essential commands and concepts necessary for effective Linux system administration.

Uploaded by

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

Linux--Notes

The document provides a comprehensive guide to Linux, covering topics such as open-source software, command-line interface commands, installation processes, user administration, disk quotas, network configuration, and various network services. It includes detailed explanations of file management, shell commands, package management, and server configurations for DNS, DHCP, FTP, and NFS. Each section outlines essential commands and concepts necessary for effective Linux system administration.

Uploaded by

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

Table of Contents

UNIT 1 : Introduction to Linux and CLI Commands..........................................................1


1.1 Introduction to Open-Source Software....................................................................1
1.2 Unix System Architecture, Linux Differences, Using a Linux System, Command
Syntax...............................................................................................................................1
1.3 File Management......................................................................................................1
1.4 Shell Commands......................................................................................................1
1.5 Text Processing........................................................................................................1
1.6 Job Control...............................................................................................................1
1.7 Filesystem Concepts.................................................................................................2
1.8 Package Management...............................................................................................2
UNIT 2 : Installation, Boot Process and User Administration.............................................2
2.1 Linux Installation, Network-Based Installation, Boot Sequence, Kernel Initialization,
Boot Loaders, Kernel Modules.........................................................................................2
2.2 User Account Management, Group Administration, Password Policies, Authentication
Configuration, File Permissions, Access Control Lists....................................................3
UNIT 3 : Disk Quotas, Storage Management, and Network Configuration........................4
3.1 Quotas, RAID Implementation, Logical Volumes, Disk and Inode limits...............4
3.2 IPv4 and IPv6 Addresses, IP Configuration, Network Troubleshooting..................4
UNIT 4 : Unit 4: Network Services and File Sharing..........................................................5
4.1 DNS and DHCP Configuration, Hostname Resolution, DNS Queries, Implementing
Servers..............................................................................................................................5
4.2 FTP, NFS, Samba Server Configuration, Directory Access.....................................6
UNIT 5 : Web, Email, Database Services, and Network Security.......................................7
5.1 Apache, HTTPD, Email Operations (SMTP, Postfix, Dovecot)..............................7
5.2 MySQL Administration............................................................................................7
5.3 Cryptography, SSH, Firewall Configuration, ACLs................................................8

1
UNIT 1 : Introduction to Linux and CLI Commands
1.1 Introduction to Open-Source Software
 Definition: Open-source software is software whose source code is freely
available for modification and distribution.
 Key Concepts: Licensing (e.g., GPL, MIT, Apache) Community-driven
development Advantages of open-source software (e.g., cost-effectiveness,
transparency, flexibility)
 Examples: Linux, Apache, MySQL, Python
1.2 Unix System Architecture, Linux Differences, Using a Linux System, Command
Syntax
Unix System Architecture:
 Kernel: Core of the operating system, manages hardware resources.
 Shell: Interface between the user and the kernel.
 Utilities: Tools and commands for performing tasks.
Linux Differences:
 Linux is a Unix-like system but is not Unix.
 Differences in licensing, development, and distribution.
Using a Linux System:
 Logging in, navigating the filesystem, and using the terminal.
Command Syntax:
 Basic structure: command [options] [arguments]
 Example: ls -l /home
1.3 File Management
Basic Commands:
 ls: List directory contents.
 cd: Change directory.
 mkdir: Create a directory.
 rm: Remove files or directories.
 cp: Copy files or directories.
 mv: Move or rename files or directories.
File Permissions:
 chmod: Change file permissions.
 chown: Change file ownership. File Types: Regular files, directories, symbolic
links, etc.
1.4 Shell Commands
In Linux, shell commands are instructions or programs that users type into a terminal
(or command-line interface) to perform specific tasks. The shell interprets these
commands and communicates with the operating system kernel to execute them.

1
All the commands we discuss in unit 1 are shell commands.
1.5 Text Processing
Tools for Text Manipulation:
 cat: Display file content.
 more/less: View file content page by page.
 head/tail: Display the beginning or end of a file.
 cut: Extract sections from lines of files.
 awk: Pattern scanning and processing.
 sed: Stream editor for filtering and transforming text.
1.6 Job Control
Job Control in Linux allows users to manage multiple processes (jobs) running in the
shell. It helps in pausing, resuming, and terminating processes directly from the
terminal.
Managing Processes:
 ps: Display active processes.
 top: Real-time system monitoring.
 kill: Terminate processes.
 bg/fg: Move processes to the background or foreground.
Job Control Commands:
 &: Run a process in the background.
 Ctrl+Z: Suspend a process.
 jobs: List background jobs.
1.7 Filesystem Concepts
Filesystem Hierarchy:
 Root file ( / )
 Standard directories (e.g. /bin, /etc, /home, /var).
Mounting and Unmounting:
 mount: Attach a filesystem.
 umount: Detach a filesystem.
Disk Usage:
 df: Display disk space usage.
 du: Estimate file space usage.
1.8 Package Management
Package management in Linux is the process of installing, updating, configuring, and
removing software. Different Linux distributions use different package managers.
Package Managers:
 Debian-based systems (e.g., Ubuntu): apt, dpkg.

2
 Red Hat-based systems (e.g., CentOS): yum, dnf, rpm.
Common Commands:
 Install: sudo apt install <package> or sudo yum install <package>.
 Remove: sudo apt remove <package> or sudo yum remove <package>.
 Update: sudo apt update or sudo yum update.
 Search: apt search <keyword> or yum search <keyword>.
Repositories:
In Linux, a "repository" refers to a centralized online storage location where pre-
compiled software packages are kept, allowing users to easily install applications and
updates on their system through a package manager by accessing these packages from
the repository. Essentially acting as a central database of available software for a
specific Linux distribution; each distribution has its own set of official repositories
containing commonly used software.
Key points about Linux repositories:
Function:
 They provide a structured way to manage and distribute software packages,
making it simple to install, update, and remove programs.
Access:
 Users access repositories using package managers like "apt" (Debian/Ubuntu)
or "yum" (Red Hat/CentOS) which can list available packages and download
them for installation.

UNIT 2 : Installation, Boot Process and User Administration


2.1 Linux Installation, Network-Based Installation, Boot Sequence, Kernel
Initialization, Boot Loaders, Kernel Modules
1. Linux Installation Definition:
Linux installation is the process of setting up a Linux operating system on a
computer. It includes selecting a distribution, creating partitions, and configuring
system settings.
 Methods: DVD/USB boot, Network-based installation, Dual boot, Virtual
machine installation.
2. Network-Based Installation Definition:
A method of installing Linux over a network instead of using physical media.
Requires a network boot (PXE), an installation server, and a Linux distribution
repository.
3. Boot Sequence Definition:
The process a computer follows to load the operating system after being powered on.

3
 Steps: Power On → BIOS/UEFI → Bootloader → Kernel → Init/Systemd →
Login Prompt.
4. Kernel Initialization Definition:
The phase where the Linux kernel is loaded into memory and begins managing
system resources.
 It detects hardware, mounts the root filesystem, and starts the first process (init
or systemd).
5. Boot Loaders Definition:
A program that loads the operating system into memory.
 Examples: GRUB (GRand Unified Bootloader), LILO (Linux Loader).
 GRUB allows selecting different kernels and OS at boot.
6. Kernel Modules

Definition:
Kernel modules are pieces of code that can be dynamically loaded into the Linux
kernel to extend its functionality.
Commands:
 lsmod (List loaded modules)
 modprobe module_name (Load a module)
 rmmod module_name (Remove a module)
2.2 User Account Management, Group Administration, Password Policies,
Authentication Configuration, File Permissions, Access Control Lists
1. User Account Management Definition:
The process of creating, modifying, and deleting user accounts in a Linux system.
Commands:
 useradd username (Create a user)
 passwd username (Set user password)
 usermod -aG group username (Add user to a group)
 userdel username (Delete a user)
2. Group Administration Definition:
Managing user groups for easier permission control in Linux.
Commands:
 groupadd groupname (Create a group)
 usermod -G groupname username (Add user to a group)
 groupdel groupname (Delete a group)
3. Password Policies Definition:
Rules that enforce strong and secure passwords for user accounts.
 Configured in /etc/login.defs and /etc/security/pwquality.conf
 Policies include minimum length, complexity, and expiration rules.

4
4. Authentication Configuration Definition:
Setting up user authentication mechanisms like passwords, biometric login, or two-
factor authentication (2FA).
Authentication methods:
 PAM (Pluggable Authentication Modules) - Controls authentication policies.
 LDAP (Lightweight Directory Access Protocol) - Centralized authentication.
 SSH Key Authentication - Secure remote login.
5. File Permissions Definition:
Rules that determine who can read, write, or execute a file in Linux.
 Permission types:
o r (Read)
o w (Write)
o x (Execute)
 Commands:
o chmod 755 file (Change file permissions)
o chown user:group file (Change file owner)

6. Access Control Lists (ACLs) Definition:


ACLs provide fine-grained permissions beyond standard file permissions.
Commands:
 getfacl file (View ACL)
 setfacl -m u:user:rwx file (Grant permissions to a specific user)
 setfacl -x u:user file (Remove user permissions)

UNIT 3 : Disk Quotas, Storage Management, and Network Configuration


3.1 Quotas, RAID Implementation, Logical Volumes, Disk and Inode limits.
1. Quotas Definition:
Quotas are limits set on disk space and the number of files (inodes) a user or group
can use.
 Used to prevent a single user from consuming too much storage.
 Commands:
o quota -u username (Check user quota)
o edquota -u username (Edit quota)
o repquota -a (Report all quotas)

2. RAID (Redundant Array of Independent Disks) Implementation


Definition:
RAID is a data storage technique that combines multiple disks to improve
performance and fault tolerance.

5
RAID Level Description
RAID 0 Striping (No redundancy, high speed)
RAID 1 Mirroring (Data is duplicated)
RAID 5 Striping with parity (Requires 3+ disks, fault-tolerant)
RAID 10 Combination of RAID 1 & 0 (Best performance and
redundancy)
 Software RAID: Managed by the OS using mdadm (Linux).
 Hardware RAID: Managed by a RAID controller.
3. Logical Volumes (LVM - Logical Volume Management)
Definition:
LVM allows flexible disk space management by grouping multiple physical disks into
one logical volume.
Commands:
 pvcreate /dev/sdX (Create a physical volume)
 vgcreate my_vg /dev/sdX (Create a volume group)
 lvcreate -L 10G -n my_lv my_vg (Create a logical volume)
4. Disk and Inode Limits
Definition:
Disk limits control storage space, while inode limits restrict the number of files a user
can create.
 Inodes store metadata about files.
 Command to check inode usage: df -i
3.2 IPv4 and IPv6 Addresses, IP Configuration, Network Troubleshooting
1. IPv4 and IPv6 Addresses
Definition:
IP addresses are unique identifiers for devices on a network.

IP Version Description
IPv4 32-bit address (e.g., 192.168.1.1),
supports ~4.3 billion devices
IPv6 IPv6 128-bit address (e.g.,
2001:db8::1), supports a much
larger number of devices

2. IP Configuration
Definition:
Configuring network interfaces with an IP address, subnet mask, gateway, and DNS.
 Static IP: Manually assigned.
o Example (/etc/network/interfaces in Debian): iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0

6
gateway 192.168.1.1
 Dynamic IP: Assigned by DHCP automatically.
o Command to get an IP via DHCP: dhclient eth0

 Check current IP configuration : ip addr show


3. Network Troubleshooting
Definition:
Diagnosing and fixing network connectivity issues using command-line tools.

Command Purpose
ping <IP> Check connectivity to a host
ifconfig / ip addr View network interfaces
netstat -tulnp Show active network connections
traceroute <IP> Track the path packets take to a
destination
nslookup <domain> Query DNS records
iptables -L View firewall rules

UNIT 4 : Unit 4: Network Services and File Sharing


4.1 DNS and DHCP Configuration, Hostname Resolution, DNS Queries,
Implementing Servers
1. DNS (Domain Name System) Configuration
Definition:
DNS translates domain names (e.g., google.com) into IP addresses (e.g.,
142.250.190.14).
 Configuration File: /etc/named.conf (for BIND DNS Server)
 Key Records:
o A (Address record) – Maps domain to IP
o MX (Mail Exchange) – Email routing
o CNAME (Canonical Name) – Alias for another domain
 Test DNS Resolution:
nslookup google.com
dig google.com
2. DHCP (Dynamic Host Configuration Protocol) Configuration
Definition:
DHCP automatically assigns IP addresses to devices in a network.
 Configuration File: /etc/dhcp/dhcpd.conf
 Example Configuration:

subnet 192.168.1.0 netmask 255.255.255.0 {

7
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1; option domain-name-servers 8.8.8.8;
}
 Start DHCP Service:
o systemctl start dhcpd

3. Hostname Resolution
Definition:
The process of mapping hostnames to IP addresses, used for communication within a
network.
 Configuration File: /etc/hosts
 Example Entry:
o 192.168.1.10 myserver.local
 Check Hostname
o hostname

4. DNS Queries
Definition:
A request sent to a DNS server to resolve a domain name to an IP address.
 Types of Queries:
o Recursive: The DNS server fully resolves the query.
o Iterative: The server returns referrals to other DNS servers.
 Test Queries:
o dig example.com
o host example.com

5. Implementing Servers
Definition:
Setting up services like DNS and DHCP to manage network communication.
 Common Servers:
o BIND (for DNS)
o ISC-DHCP (for DHCP)
o Apache/Nginx (for Web Hosting)
 Starting Services:
systemctl start named # Start DNS
systemctl start dhcpd # Start DHCP

4.2 FTP, NFS, Samba Server Configuration, Directory Access


1. FTP (File Transfer Protocol) Configuration
Definition:
FTP is a protocol for transferring files between computers over a network.
 FTP Server: vsftpd (Very Secure FTP Daemon)

8
 Installation & Start:
sudo apt install vsftpd  install
systemctl start vsftpd  start
 Configuration File: /etc/vsftpd.conf
 Allow Anonymous Access:
Bash anonymous_enable=YES
2. NFS (Network File System) Configuration
Definition:
NFS allows file sharing between Linux systems over a network.
 Install NFS Server:
o sudo apt install nfs-kernel-server
 Share a Directory: Add to /etc/exports:
o /shared_directory 192.168.1.0/24(rw,sync,no_root_squash)
 Restart Service:
o systemctl restart nfs-kernel-server

3. Samba Server Configuration


Definition:
Samba allows Linux and Windows to share files and printers.
 Install Samba:
o sudo apt install samba
 Configuration File: /etc/samba/smb.conf
 Example Share:
[shared]
path = /home/user/shared
read only = no
browsable = yes
 Restart Samba:
o systemctl restart smbd

4. Directory Access
Definition:
Controlling access to shared directories based on user permissions.
 Check Permissions
o ls -ld /shared_folder
 Change Ownership:
o chown user:group /shared_folder
 Modify Permissions:
o chmod 770 /shared_folder

UNIT 5 : Web, Email, Database Services, and Network Security

9
5.1 Apache, HTTPD, Email Operations (SMTP, Postfix, Dovecot)
1. Apache and HTTPD
Definition:
Apache HTTP Server (httpd) is an open-source web server used to host websites.
 Install Apache:
o sudo apt install apache2 # Debian-based
o sudo yum install httpd # RHEL-based
 Start and Enable Apache:
o systemctl start apache2 # Debian-based
o systemctl start httpd # RHEL-based
o systemctl enable apache2
 Configuration File:
o /etc/apache2/apache2.conf (Debian)
o /etc/httpd/conf/httpd.conf (RHEL)

2. Email Operations (SMTP, Postfix, Dovecot)


Definition:
Email services use protocols like SMTP for sending and IMAP/POP3 for receiving.
SMTP (Simple Mail Transfer Protocol)
 Definition: SMTP is used to send emails between mail servers.
 Command to Test SMTP:
o telnet smtp.example.com 25

Postfix (Mail Transfer Agent - MTA)


 Definition: Postfix is an MTA that routes and delivers emails.
 Install Postfix:
o sudo apt install postfix
 Configuration File: /etc/postfix/main.cf
 Start Postfix:
o systemctl start postfix

Dovecot (IMAP/POP3 Server)


 Definition: Dovecot is used for email retrieval via IMAP/POP3.
 Install Dovecot:
o sudo apt install dovecot-imapd dovecot-pop3d
 Configuration File: /etc/dovecot/dovecot.conf
 Start Dovecot:
o systemctl start dovecot

5.2 MySQL Administration


Definition:
MySQL is a relational database management system (RDBMS) used for storing and
managing data.

10
 Install MySQL Server:
o sudo apt install mysql-server
 Start MySQL:
o systemctl start mysql
 Login to MySQL:
o mysql -u root -p
 Common SQL Commands:
o sql
CREATE DATABASE mydb;
USE mydb;
CREATE TABLE users (id INT PRIMARY KEY, name
VARCHAR(50));
INSERT INTO users VALUES (1, 'John');
SELECT * FROM users;

5.3 Cryptography, SSH, Firewall Configuration, ACLs


1. Cryptography
 Definition:Cryptography secures data using encryption and hashing
techniques.
 Encryption: Converts data into unreadable format (AES, RSA).
 Hashing: One-way transformation of data (SHA-256, MD5).
 Generate an Encrypted Password:
o openssl passwd -6 "mypassword"

2. SSH (Secure Shell)


 Definition: SSH allows secure remote login and command execution.
 Install SSH Server:
o sudo apt install openssh-server
 Start SSH Service:
o systemctl start ssh
 Connect to a Remote Server:
o ssh user@remote-ip

3. Firewall Configuration
Definition:
A firewall controls incoming and outgoing network traffic based on rules.
Using UFW (Uncomplicated Firewall) – Debian
 Enable UFW and Allow Services:
sudo ufw enable
sudo ufw allow 22/tcp # Allow SSH
sudo ufw allow 80/tcp # Allow HTTP
sudo ufw status

11
Using Firewalld - RHEL
 Start Firewalld and Add Rules:
sudo systemctl start firewalld
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload
4. Access Control Lists (ACLs)
Definition:
ACLs allow fine-grained permission control beyond standard Linux file permissions.
 Set ACL on a File:
o setfacl -m u:john:rwx /data/file.txt
 Check ACLs:
o getfacl /data/file.txt

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy