Comprehensive Overview of Linux

Aug 25, 2024

Linux Overview Lecture Notes

What is Linux?

  • Linux is the kernel that powers the Linux operating system.
  • The kernel manages hardware and resources, and separates processes into kernel and user land for security.

Linux Distributions

  • Different types of operating systems based on the Linux kernel include GNU/Linux and Android.
  • A Linux distribution is a combination of the Linux kernel and other software.
  • Examples of families of distributions:
    • Red Hat Family (e.g., Fedora, CentOS)
    • Debian Family (e.g., Debian, Ubuntu, Mint)
    • Source Code Distributions (e.g., Arch, Gentoo)

Red Hat Package Management

  • RPM files are used for package management in Red Hat family.
  • RPM files track installed packages and their dependencies.

Debian Package Management

  • Debian uses .deb files for package management.
  • Focuses more on user experience compared to Red Hat.

Kernel Initialization and Systemd

  • The kernel initializes processes with init, which has evolved to systemd for better organization.
  • Systemd starts services in parallel, improving boot time efficiency.

Installation Considerations

  • Ensure machine can boot installation media (CD, USB, network).
  • Hardware requirements include hard drive space and RAM.
  • Video card and wireless card compatibility are important.

Installation Methods

  • Installation can be done via DVD, USB, or network.
  • Set correct time and date during installation.

Software Selection

  • Choose software packages during installation;
    • Minimal install for servers.
    • Full install for desktop environments.

Partitioning

  • Linux partitions include root, swap, and boot partitions.
  • LVM (Logical Volume Management) allows flexible volume resizing.

File System

  • File systems must be formatted for use.
  • Common file systems: ext4, xfs, btrfs.

User Management

  • Root user has total control; create additional users for security.
  • Use strong passwords and unique usernames.

Boot Process

  • The bootloader loads the kernel, followed by init/systemd.
  • Kernel processes manage system resources and user processes.

Command-Line Navigation

  • Basic commands: pwd, ls, cd, cat, etc.
  • Environment variables can be set using the export command.

File Management

  • Create, edit, move, and delete files using commands like touch, mv, rm, nano, etc.

Networking

  • Configure hostname, network settings (DHCP/static), and firewall rules.

System Logs

  • Log files are stored in /var/log/.
  • Logs include messages, secure logs, mail logs, and more.

Troubleshooting

  • Check system logs for errors, verify services are running, and monitor network settings.

Kernel Modules

  • Kernel modules are used to add functionality to the Linux kernel, such as device drivers.
  • Use lsmod to see loaded modules, modprobe to load/unload them.

DHCP Overview

  • DHCP automates the IP address assignment process using messages and leases.
  • Security concerns include rogue DHCP servers and spoofed addresses.

DNS Overview

  • DNS translates domain names to IP addresses, reducing reliance on static host files.
  • Security issues include spoofing and DNS redirection.

SNMP Overview

  • SNMP gathers statistical information from network devices.
  • Uses UDP for communication; security concerns include weak community strings.

Apache Web Server

  • Apache serves web pages over HTTP/HTTPS.
  • Configuration files are typically found in /etc/httpd/.

MySQL/MariaDB Overview

  • MariaDB is a drop-in replacement for MySQL with a focus on open-source.
  • SQL commands include SELECT, INSERT, UPDATE, DELETE.

Summary

  • Linux is a powerful operating system used widely in servers and desktops.
  • Understanding the kernel, distributions, package management, and system administration is crucial for effective use.