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

Lecture

The document covers various topics related to backup tools, scripting basics, virtualization, cloud computing, SSH, RAID, and extended permissions. It includes definitions, key features, commands, and practical applications for each topic, along with exam preparation tips. The content is structured in a lecture format, providing essential information for understanding and implementing these concepts.

Uploaded by

Karan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lecture

The document covers various topics related to backup tools, scripting basics, virtualization, cloud computing, SSH, RAID, and extended permissions. It includes definitions, key features, commands, and practical applications for each topic, along with exam preparation tips. The content is structured in a lecture format, providing essential information for understanding and implementing these concepts.

Uploaded by

Karan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Lecture#09

Lecture 09: Backup Tools - Main Points Defined

Objectives

1. Introduction of Backup Tools: Understand tools used for data backup to protect against
loss.
2. Implementation of Backup Tools: Learn how to use these tools practically for efficient
backups.

Backup Tools and Their Explanation

1. Simple Copy

 Definition: A basic method to copy data from one location to another.


 Command:
 cp -av /home/data/* /backup/
o -a: Preserves the file structure, permissions, and attributes.
o -v: Displays detailed information of the copying process.
 Use Case: Quick duplication of data to a backup directory.

2. Rsync

 Definition: A powerful, network-enabled tool for synchronizing files and directories.


 Key Features:
o Handles local and remote file transfers.
o Performs incremental backups, transferring only changed parts of files.
o Preserves permissions, links, and timestamps.
 Modes:
1. Local Rsync: For copying files within the same system.
2. Remote Push: Sends data from the local system to a remote one.
3. Remote Pull: Retrieves data from a remote system to the local system.

3. Tar Utility
 Definition: "Tar" stands for Tape Archive, a utility for archiving multiple files into a
single file.
 Use Cases:
o Create compressed backups.
o Extract and manage archived files.
 Key Commands:
1. Create a Tar Archive:
2. tar -cvf archive.tar /path/to/files
 -c: Create a new archive.
 -v: Show progress.
 -f: Specify the file name.
3. Create a Gzipped Tar Archive:
4. tar -czvf archive.tar.gz /path/to/files
 -z: Compress with gzip.
5. Create a Bzip2 Tar Archive:
6. tar -cjvf archive.tar.bz2 /path/to/files
 -j: Compress with bzip2.
7. Extract Files from a Tar Archive:
8. tar -xvf archive.tar
 -x: Extract files from
the archive.
9. Uncompress a Bzipped Tar Archive:
10. tar -xjvf archive.tar.bz2
11. List Contents of a Tar Archive:
12. tar -tvf archive.tar
 -t: Display the files in the archive.

References for Practical Examples

1. Server World Tutorials:


o Link
2. Tecmint Command Examples:
o Link

Key Exam Preparation Points

 Command Syntax: Be able to write and explain the commands for cp, rsync, and tar.
 Comparison:
o Understand the difference between rsync and cp.
o Explain the advantages of using tar for backups.
 Scenarios:
o Given a situation, decide whether to use cp, rsync, or tar.

Let me know if you need further examples or clarifications!


Lecture#10
Lecture 10: Command & Basics of Scripting - Main Points Defined

Objectives

1. Understand background and foreground processes in UNIX/Linux.


2. Learn the basics of bash scripting.
3. Implement common commands and scripting techniques.

Main Topics and Definitions

1. Job/Process

 Job: A group of one or more processes in a UNIX/Linux shell.


o A process is a program under execution.
o A job may include processes running in series or parallel.

2. Foreground and Background Jobs

 Foreground Job:
o The shell waits for the process to complete before accepting new commands.
o Example: Running ls to list files.
 Background Job:
o The shell does not wait for the process to finish, allowing you to run additional
commands.
o Execute a background job using the ampersand (&) operator.
o Example:
o sleep 10 &

3. Introduction to Scripting

 What is Bash?
o A command-line shell used for writing and executing scripts.
o Scripts automate repetitive tasks using a series of commands.
 Permissions in Scripting:
o Grant execute permission to a script using:
o chmod +x script_name.sh

4. Basic Scripting Programs

1. Write to Output:
2. echo "Hello, World!"
3. Read User Input:
4. echo "Enter your name:"
5. read name
6. echo "Hello, $name!"
7. Arithmetic Operations:
8. num1=5
9. num2=3
10. sum=$((num1 + num2))
11. echo "Sum: $sum"
12. Script Execution:
o Execute the script:
o ./script_name.sh

5. Important Command-Line Operators

1. Ampersand Operator (&):


o Runs a command in the background.
2. Semi-Colon Operator (;):
o Chains commands sequentially.
o Example:
o ls; pwd
3. AND Operator (&&):
o Executes the next command only if the previous command succeeds.
o Example:
o mkdir test && cd test
4. OR Operator (||):
o Executes the next command if the previous command fails.
o Example:
o ls nonexistent_file || echo "File not found"
5. NOT Operator (!):
o Negates a command or condition.
o Example:
o ! ls nonexistent_file
6. AND-OR Combination (&& – ||):
o Combines AND and OR logic.
o Example:
o [ -d dir ] && echo "Directory exists" || echo "Directory does not
exist"
7. PIPE Operator (|):
o Passes the output of one command as input to another.
o Example:
o ls | grep file
8. Command Combination Operator ({}):
o Groups multiple commands.
o Example:
o { echo "Creating directory"; mkdir test; }
9. **Precedence Operator (()):
o Defines the order of execution in complex expressions.
o Example:
o ((5 + 3) * 2)

6. References

1. Bash Scripting Tutorials


2. Command Chaining Examples

Key Points for Exam Preparation

1. Understand Concepts:
o Jobs and processes (foreground vs. background).
o Basics of bash scripting.
2. Memorize Commands:
o Practice command syntax and behavior for &&, ||, |, and others.
3. Scenarios:
o Write scripts for basic operations like reading input, arithmetic, and chaining
commands.
4. Explain Use Cases:
o Why use background jobs?
o How do logical operators improve scripting efficiency?

If you need additional details or practical examples, let me know!


Lecture#11
Lecture 11: Hypervisors, VPS, and Cloud - Main Points Defined

Objectives

1. Understand Hypervisors and their types.


2. Explore Virtualization, Virtual Private Servers (VPS), and the Cloud.
3. Learn about Cloud Service Models and Cloud Types.
4. Compare VPS and Cloud hosting.

1. Hypervisors

 Definition:
o A hypervisor, or virtual machine monitor (VMM), enables multiple operating
systems (OS) to run concurrently on a single host computer.
o Acts as a traffic controller for system resources like memory and I/O.
 Types of Hypervisors:
1. Type 1 Hypervisor (Bare Metal):
 Runs directly on system hardware.
 Examples: VMware ESXi, Microsoft Hyper-V, Xen.
2. Type 2 Hypervisor (Hosted):
 Runs on a host operating system.
 Examples: KVM, VMware Player, Oracle VirtualBox.

2. Virtualization

 Full Virtualization:
o The guest OS operates as though it runs on dedicated hardware without knowing
about the hypervisor.
o Limitation: Performance issues due to hardware emulation.
 Para-Virtualization:
o The guest OS is aware of being virtualized and communicates directly with the
host OS.
o Limitation: Requires modifications to the guest OS, leading to compatibility
issues.
3. Virtual Private Server (VPS)

 Definition:
o A virtual machine provided as a service by hosting companies.
o Each VPS runs its own OS and allows users to install custom software.
 Key Features:
o Dedicated resources within a shared environment.
o Full administrative (superuser) access.

4. Cloud Computing

 Definition:
o Delivery of on-demand computing resources (applications, storage, data centers)
over the internet on a pay-per-use basis.
 Key Characteristics:
1. Elastic Resources: Scales up/down quickly.
2. Metered Service: Pay only for what you use.
3. Self-Service: Access resources independently.

5. Cloud Service Models

1. SaaS (Software as a Service):


o Provides ready-to-use applications over the internet.
o Benefits:
 Accessible from anywhere.
 No data loss as it is stored in the cloud.
 Dynamic scaling for demand.
 Example: Gmail, Salesforce.
2. PaaS (Platform as a Service):
o Offers a platform for developers to build and deploy applications.
o Benefits:
 Reduces complexity with middleware.
 Faster deployment and development cycles.
 Example: Google App Engine, Microsoft Azure.
3. IaaS (Infrastructure as a Service):
o Provides virtualized computing resources like servers and storage.
o Benefits:
 No need to purchase hardware.
 Scalable infrastructure on demand.
 Example: Amazon EC2, Rackspace.
6. Types of Cloud

1. Public Cloud:
o Owned by third-party providers.
o Accessible via the internet.
o Examples: AWS, Microsoft Azure.
o Key Features:
 Affordable computing resources.
 Scalable IaaS, SaaS, and PaaS services.
2. Private Cloud:
o Exclusive infrastructure for a single organization.
o Offers greater control, security, and customization.
o Hosted internally or externally.
3. Hybrid Cloud:
o Combines private and public clouds.
o Benefits:
 Keeps sensitive data in private environments.
 Leverages public cloud for scalability and modern applications.

7. VPS vs. Cloud Hosting

1. Infrastructure:
o VPS: A single server partitioned into multiple virtual servers.
o Cloud: A network of interconnected servers providing resources.
2. Availability:
o VPS: Downtime during server failure.
o Cloud: Minimal downtime as resources are rerouted to another server.
3. Payment Model:
o VPS: Payment for pre-allocated resources.
o Cloud: Pay-as-you-go model.
4. Resource Distribution:
o VPS: Shared CPU and memory among all VPS slices.
o Cloud: Dedicated resources as per allocation.
5. Choice of OS:
o VPS: Limited to the host OS.
o Cloud: Flexible to install or replace any OS.

References

1. IBM Cloud Computing


2. Difference Between Hypervisor Types
3. Virtualization Insights
Exam Preparation Tips

1. Memorize Definitions:
o Hypervisors (Type 1 and Type 2), VPS, and Cloud.
2. Understand Comparisons:
o Full vs. Para-Virtualization.
o VPS vs. Cloud.
o Public vs. Private vs. Hybrid Clouds.
3. Practical Applications:
o Be prepared to explain real-world use cases for SaaS, PaaS, and IaaS.
4. Examples:
o Include examples of hypervisors and cloud services in answers.

Let me know if you need further clarifications or in-depth explanations!

Lecture#12
Lecture 12: SSH Key Pairs & RAID - Main Points Defined

Objectives

1. Compare SSH and Telnet.


2. Understand the basics and implementation of SSH Key Pairs.
3. Learn about RAID and its types.

1. Telnet

 Definition:
o A terminal emulation protocol enabling remote connection to a host over port 23.
o Example:
o telnet hostname
 Use Case:
o Manage files or accounts on remote computers.
 Limitation:
o No encryption, making it insecure for sensitive data.

2. SSH (Secure Shell)

 Definition:
o A cryptographically secured protocol for remote communication and command
execution.
 Key Features:
o Authentication of client and server.
o Encryption of data transfer.
 How It Works:
1. The client sends the ID of the key pair for authentication.
2. The server checks for a matching public key in the authorized_keys file.
3. If found, the server encrypts a random number using the public key and sends it to
the client.
4. The client decrypts the message using the private key, calculates an MD5 hash
with the session key, and sends it back.
5. The server verifies the hash; if it matches, authentication is successful.

3. SSH-Keygen

 Definition:
o A tool for generating authentication key pairs for SSH.
 Use Case:
o Automates logins and authenticates hosts securely.
 Key Generation Command:
 ssh-keygen
 Generated Keys:
o Private Key: Stored securely by the client.
o Public Key: Shared with the server for authentication.

4. RAID (Redundant Array of Independent Disks)

 Definition:
o A method of storing the same data across multiple disks to improve fault
tolerance and performance.
 How It Works:
o Data is distributed across multiple disks.
o I/O operations overlap to enhance speed.
o Redundant storage increases fault tolerance.

5. RAID Controller

 Definition:
o A hardware or software component that abstracts groups of disks as logical units.
 Benefits:
o Enhances performance.
o Protects data during crashes.

6. RAID Levels

1. RAID 0 (Striping):
o Data is divided across disks.
o Advantage: High performance.
o Disadvantage: No fault tolerance.
2. RAID 1 (Mirroring):
o Data is duplicated across two or more disks.
o Advantage: Fault tolerance; faster read performance.
o Disadvantage: Storage capacity is halved.
3. RAID 2:
o Uses striping with error-checking and correcting (ECC).
o Note: Obsolete and not commonly used.
4. RAID 3:
o Data is striped, with one disk dedicated to storing parity information.
o Use Case: Sequential data access.
5. RAID 4:
o Similar to RAID 3 but stores parity information on a dedicated disk.
6. RAID 5:
o Striping with parity:
 Parity is distributed across all disks.
 Advantage: Can survive the failure of one disk.
 Disadvantage: Write operations are slower due to parity calculation.
7. RAID 6:
o Similar to RAID 5, but with dual parity for added redundancy.
o Advantage: Can survive two disk failures.

References

1. SSH Keygen Tool


2. RAID Overview

Exam Preparation Tips

1. Understand Comparisons:
o SSH vs. Telnet.
o RAID levels and their differences.
2. Command Usage:
o Practice SSH key generation and connection setup.
3. Fault Tolerance in RAID:
o Be prepared to explain how RAID levels handle disk failures.
4. Use Cases:
o Relate RAID configurations to practical scenarios (e.g., high-performance
systems or data-critical environments).

Let me know if you need further clarifications!

Lecture#13
Lecture 13: Extended Permissions & Database - Main Points Defined

Objectives

1. Understand Extended Permissions using Access Control Lists (ACL).


2. Learn the basics of Databases and their applications.
3. Explore the use and management of MySQL.

1. Access Control List (ACL)

 Definition:
o ACL provides a more flexible permission system than traditional UNIX file
permissions.
o It allows specific users or groups to have custom permissions on any file or
directory.
 Key Features:
o Granular permissions for users and groups.
o Extends beyond the owner-group-others model.
 Command to Modify ACL:
o To add permissions for a user:
o setfacl -m u:username:permissions filename
o To add permissions for a group:
o setfacl -m g:groupname:permissions filename

2. Databases

 Definition:
o A database is a structured collection of data stored electronically.
 Examples:
o Online store databases (products, customers, orders).
o Forum databases (members, topics, posts).
o Blog system databases (users, posts, categories, comments).
 Why Use Databases?
o Structured and efficient storage.
o Handles large amounts of data better than plain text files (e.g., CSV).

3. Relational Databases

 Definition:
o Stores data in tables with defined relationships between them.
o Enables querying and managing interconnected data.

4. Database Packages in Linux

 Common database packages:


1. Oracle
2. MongoDB (NoSQL)
3. MariaDB
4. MySQL
5. SAP HANA

5. MySQL
 Advantages:
o Open source and free to use.
o Compatible with various platforms and web hosting setups.
o Easy to use and integrates well with PHP.
 MySQL Installation:
o Recommended method: Install using RPM.
o Components:
1. MySQL: Core database server.
2. MySQL-client: Enables interaction with the server.
3. MySQL-devel: Libraries for compiling MySQL-related programs.
4. MySQL-shared: Shared libraries for the client.
5. MySQL-bench: Performance testing tools.

6. MySQL Commands

1. Database Selection:
2. USE databasename;
3. Show Databases:
4. SHOW DATABASES;
5. Show Tables in Database:
6. SHOW TABLES;
7. Show Columns of a Table:
8. SHOW COLUMNS FROM tablename;
9. Show Index Details:
10. SHOW INDEX FROM tablename;
11. Performance Stats:
12. SHOW TABLE STATUS LIKE 'tablename'\G;

7. Backup and Restore Databases

 Backup:
o Command to back up all databases:
o mysqldump --all-databases --single-transaction --user=root --
password > all_databases.sql
 Restore:
o Command to restore a database:
o mysql -u root -p < all_databases.sql

References

1. ACL Configuration
2. MySQL for Beginners
Exam Preparation Tips

1. Commands:
o Memorize the ACL modification commands (setfacl) and common MySQL
administrative commands.
2. Concepts:
o Be able to explain the purpose of ACL, relational databases, and MySQL
advantages.
3. Practical Scenarios:
o Practice backing up and restoring MySQL databases.
o Provide examples of when to use ACL vs. traditional permissions.

Let me know if you need deeper clarification or specific examples!

Lecture#14
Lecture 14: DNS & DHCP - Main Points Defined

Objectives

1. Understand DNS (Domain Name System) and how it works.


2. Learn about DHCP (Dynamic Host Configuration Protocol) and its application.

1. DNS (Domain Name System)

 Definition:
o Translates domain and host names into IP addresses and vice versa.
o Example: Converts www.example.com to its corresponding IP address.
 Why Use DNS?:
o Simplifies remembering hostnames instead of numerical IP addresses.

How DNS Works

1. Forward DNS:
o Resolves domain names into IP addresses.
2. Reverse DNS:
o Resolves IP addresses back to domain names.

DNS Database

 Definition:
o A distributed, hierarchical database used for hostname-IP address lookups.
o Fully Qualified Domain Names (FQDN) structure:
 Top-Level Domain Names (TLDN):
 .com, .org, .edu, .net, etc.
 Managed by root servers.
 Second-Level Domains:
 Organizational identifiers like example.com or redhat.com.
 Hostnames:
 Specific hosts like host1.example.com.

DNS Root Servers

 The top-tier DNS servers storing a complete domain name database.


 13 DNS Root Servers:
o Named A through M.
o Located globally (e.g., USA, London, Stockholm, Japan).

DNS Record Types

1. A Record:
o Maps domain names to IPv4 addresses.
2. AAAA Record:
o Maps domain names to IPv6 addresses.
3. CNAME Record:
o Creates aliases for domain names.
4. MX Record:
o Specifies mail servers for routing emails.
5. NS Record:
o Identifies authoritative name servers for a domain.
6. PTR Record:
o Used for reverse DNS lookups (IP to domain).
7. SOA Record:
o Contains administrative details about a DNS zone.
8. TXT Record:
o Stores arbitrary text, often used for email security (e.g., SPF records).
2. DHCP (Dynamic Host Configuration Protocol)

 Definition:
o Automates IP address assignment to devices on a network.
o Ensures devices receive proper network configurations like subnet masks and
gateways.

DHCP Concept

 Lease Process:
1. A client requests an IP address.
2. DHCP server assigns an available address.
3. Address is leased for a defined period.

DHCP Configuration

1. Installation:
o Install the DHCP server package on a network server.
2. Configuration File:
o Define IP address ranges, subnet masks, and lease durations.
o Example: /etc/dhcp/dhcpd.conf.
3. MAC Binding:
o Bind a specific IP address to a device’s MAC address.

References

1. DNS Record Viewer


2. DHCP and DNS Configuration

Exam Preparation Tips

1. Understand Concepts:
o Be able to explain the purpose of DNS and DHCP.
o Differentiate between Forward DNS and Reverse DNS.
2. Memorize Key DNS Records:
o A, AAAA, CNAME, MX, PTR, NS, SOA, and TXT.
3. DHCP Scenarios:
o Practice explaining IP address assignment and lease processes.
4. Real-World Applications:
o Provide examples where DNS simplifies web browsing and DHCP streamlines
network configuration.

Let me know if further clarification or specific examples are needed!

Lecture#15
Lecture 15: HTTP, HTTPS & NTP - Main Points Defined

Objectives

1. Understand HTTP and HTTPS protocols and their usage.


2. Learn about HTTP Caching and its benefits.
3. Explore NTP (Network Time Protocol) and its importance.

1. HTTP (HyperText Transfer Protocol)

 Definition:
o A set of standards allowing the exchange of information (e.g., HTML pages) over
the World Wide Web.
 Key Features:
o Works over an unencrypted connection.
o Vulnerable to eavesdropping and data interception.
o Commonly used for general web browsing where security is not critical.

2. HTTPS (HyperText Transfer Protocol Secure)

 Definition:
o A secure version of HTTP that uses Transport Layer Security (TLS) to encrypt
data.
 Key Features:
o Protects data from eavesdropping.
o Default protocol for financial transactions and sensitive data exchanges.
o Shields users from censorship by governments or ISPs.

3. HTTP Caching

 Definition:
o Temporary storage of web content (e.g., HTML pages, images) to reduce server
lag and speed up subsequent requests.
 Categories of Caches:
1. Private Cache:
 Stored on a user’s device (e.g., browser cache).
2. Public Cache:
 Stored on shared infrastructure (e.g., proxy servers).
 Benefits:
o Reduces bandwidth usage.
o Speeds up website load times.
o Decreases server load.

4. NTP (Network Time Protocol)

 Definition:
o A protocol for synchronizing the clocks of computer systems over data networks
with variable latency.
 Importance:
o Accurate Timekeeping:
 Prevents issues in distributed systems and security mechanisms.
o Consistency:
 File system updates and coordinated processes depend on synchronized
clocks.
 How NTP Works:
1. The NTP client sends a time request to the NTP server.
2. The server responds with the correct time.
3. The client adjusts its clock based on the server's response.

Exam Preparation Tips

1. Key Differences:
o Understand and explain the differences between HTTP and HTTPS.
o Emphasize the added security benefits of HTTPS.
2. Caching:
o Know the types of caching (private vs. public) and their use cases.
3. NTP Significance:
o Highlight scenarios where accurate timekeeping is crucial (e.g., security,
distributed systems).
4. Practical Examples:
o Provide examples of HTTPS usage in e-commerce or banking.
o Mention NTP's role in ensuring synchronized timestamps in transaction logs.

Let me know if you need further details or examples!

You might also like