codemaniacstudio

Unit 4. Linux Administration

Unit 4. Linux Administration

INDEX

Overview
  • 4.1. Installing Linux
  • 4.2.Installation of Open Source Software
  • 4.3.Maintaining User Accounts
  • 4.4.System Config Services (Package)

Installing Linux in an Operating System.

Introduction.

  • Linux is a widely used open-source operating system that offers flexibility, security, and high performance.
  • It can be installed on desktops, laptops, and servers, either as a primary operating system or alongside other operating systems like Windows.
  • The installation process may vary depending on the distribution (Ubuntu, Fedora, Debian, etc.), but the general steps remain the same.

1. Prerequisites for Installing Linux

  • Before installing Linux, the following requirements should be met:

1.1 System Requirements

  • Processor: 64-bit (or 32-bit for older systems).
  • RAM: Minimum 2GB (Recommended: 4GB or more).
  • Storage Space: Minimum 25GB free disk space.
  • USB Drive/DVD: At least 8GB storage for creating bootable media.

1.2 Download Linux ISO

  • Visit the official website of the chosen Linux distribution (e.g., Ubuntu, Fedora, Debian).
  • Download the ISO file of the latest stable version.

1.3 Create a Bootable USB Drive

To install Linux, a bootable USB or DVD is required. The bootable media can be created using:

  • Rufus (Windows)
  • balenaEtcher (Windows, macOS, Linux)
  • dd command (Linux Terminal)

2. Steps to Install Linux

Step 1: Boot from the USB Drive

  • Insert the bootable USB drive into the computer.
  • Restart the system and enter the BIOS/UEFI settings (Press F2, F12, DEL, or ESC depending on the manufacturer).
  • Change the boot order to prioritize the USB device.
  • Save changes and exit BIOS. The system will boot into the Linux installer.

Step 2: Select Installation Type

Once the system boots into the Linux installation screen:

  • Choose “Try Linux” (to test it without installing) or “Install Linux” (to proceed with installation).

Step 3: Configure Language, Keyboard, and Time Zone

  • Select the preferred language for the installation process.
  • Choose the keyboard layout (default is usually English (US)).
  • Set the time zone based on location.

Step 4: Choose Installation Type

The installer provides different installation options:

  • Erase Disk and Install Linux: Replaces the existing OS with Linux.
  • Install Linux Alongside Windows: Dual boot with Windows.
  • Something Else: Custom partitioning (for advanced users).

If installing alongside Windows, select the dual boot option.

Step 5: Partition the Disk (Optional for Advanced Users)

  • Select the disk where Linux will be installed.
  • Create partitions manually if needed:
    • / (Root Partition) – Minimum 20GB for system files.
    • /home (Home Partition) – Stores user files and settings.
    • Swap Partition – Recommended equal to RAM size for better performance.

Step 6: Create a User Account

  • Set up a username and password for the administrator account.
  • Choose whether to enable automatic login or require a password at startup.

Step 7: Start Installation

  • Click “Install Now” and wait for the installation to complete.
  • The process may take 10-30 minutes, depending on the system speed.

Step 8: Restart and Boot into Linux

  • Once installation is complete, remove the USB drive.
  • Restart the system, and it will boot into the newly installed Linux OS.

3. Post-Installation Setup

After installing Linux, some essential setup steps include:

  • Update the System: Run sudo apt update && sudo apt upgrade (for Ubuntu/Debian).
  • Install Essential Software: Web browser, office suite, media players.
  • Enable Additional Drivers: Install drivers for Wi-Fi, graphics, and peripherals.
  • Customize Settings: Configure themes, layouts, and system preferences.

Installation of Open Source Software in an Operating System.

Introduction.

  • Open-source software (OSS) is software with source code that is freely available for modification, distribution, and enhancement.
  • It is widely used for personal, business, and enterprise applications due to its flexibility, security, and cost-effectiveness. Installing open-source software on an operating system varies based on the OS (Windows, Linux, macOS) and the software distribution method.

1. Prerequisites for Installing Open Source Software

1.1 System Requirements

  • Compatible Operating System (Windows, Linux, macOS).
  • Sufficient Disk Space for installation.
  • Administrator Permissions (especially for system-wide installations).
  • Internet Connection (for downloading software or dependencies).

1.2 Choosing Open Source Software

  • Open-source software is available on official websites, package managers, and repositories.
  • Examples of popular open-source software:
    • Web Browsers: Mozilla Firefox, Chromium.
    • Office Suites: LibreOffice, Apache OpenOffice.
    • Media Players: VLC Media Player.
    • Development Tools: Visual Studio Code, Eclipse, GIMP.
    • Operating Systems: Ubuntu, Fedora, Debian.

2. Methods of Installing Open Source Software

2.1 Installing Open Source Software on Windows

Method 1: Using an Installer (Executable File – .exe or .msi)

  1. Download the software from the official website.
  2. Double-click the .exe or .msi file to launch the installer.
  3. Follow the installation wizard:
    • Accept terms and conditions.
    • Choose the installation directory.
    • Select additional components (if required).
  4. Click “Install” and wait for the process to complete.
  5. Open the software from the Start Menu or Desktop shortcut.

Method 2: Using Windows Package Managers (Chocolatey, Winget)

  1. Open Command Prompt (cmd) or PowerShell as Administrator.
  2. Install Chocolatey or Winget (if not already installed).
  3. Run the command:
    nginx
    choco install software-name
    or
    nginx
    winget install software-name
  4. Wait for the process to finish, then launch the software.

2.2 Installing Open Source Software on Linux

Method 1: Using Package Managers

Most Linux distributions have built-in package managers:
  • Debian/Ubuntu: apt
  • Fedora: dnf
  • Arch Linux: pacman
Steps:
  1. Open the Terminal.
  2. Update the package repository:
    nginx
     
    sudo apt update && sudo apt upgrade # Ubuntu/Debian sudo dnf update # Fedora sudo pacman -Syu # Arch Linux
  3. Install the software using the package manager:
    nginx
    sudo apt install software-name # Ubuntu/Debian sudo dnf install software-name # Fedora sudo pacman -S software-name # Arch Linux
  4. Once installed, launch the application from the menu or terminal.

Method 2: Installing from Source Code

If the software is not available in repositories, it can be compiled from source:
  1. Download the source code (.tar.gz or .zip) from the official website.
  2. Extract the files:
    pgsql
    tar -xvzf software-name.tar.gz cd software-name
  3. Install dependencies (if required).
  4. Compile and install:
    go
    ./configure make sudo make install
  5. Run the software using the terminal.

Method 3: Using Snap, Flatpak, or AppImage

  1. Install Snap (if not already installed):
    nginx
    sudo apt install snapd
    Then install software:
    nginx
    sudo snap install software-name
  2. Install Flatpak:
    nginx
    sudo apt install flatpak
    Then install software:
    nginx
    flatpak install software-name
  3. AppImage:
    • Download the .AppImage file.
    • Make it executable:
      bash
      chmod +x software.AppImage
    • Run the software:
      bash
      ./software.AppImage

2.3 Installing Open Source Software on macOS

Method 1: Using Homebrew (Package Manager)

  1. Open Terminal.
  2. Install Homebrew (if not installed):
    bash
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Install software:
    nginx
    brew install software-name

Method 2: Using .dmg or .pkg Files

  1. Download the software from the official website.
  2. Open the .dmg file and drag the application to the Applications folder.
  3. Open the software from the Launchpad.

3. Post-Installation Steps

After installation, follow these steps to ensure smooth usage:
  • Update software regularly using package managers or built-in update tools.
  • Configure settings based on user preferences.
  • Check for dependencies if the software does not run properly.
  • Verify installation by running the software from the menu or terminal.

Maintaining User Accounts in an Operating System.

Introduction.

  • User account management is an essential feature of an operating system that ensures security, privacy, and controlled access to system resources.
  • Operating systems like Windows, Linux, and macOS provide tools to create, modify, and manage user accounts, helping administrators control user permissions, data security, and resource allocation.

1. Importance of User Account Management

  • Security: Prevents unauthorized access to the system.
  • Privacy: Each user has a separate workspace and files.
  • Access Control: Assigns different privileges to users based on roles.
  • Resource Management: Limits resource usage for different users.
  • Audit and Monitoring: Tracks user activities for security and troubleshooting.

2. Types of User Accounts

2.1 Administrator Account

  • Has full control over the system.
  • Can install software, manage users, and modify system settings.
  • Found in both Windows and Linux (root user in Linux).

2.2 Standard/User Account

  • Used for regular system operations.
  • Cannot install software or modify system settings without admin permission.

2.3 Guest Account

  • Provides temporary access with limited privileges.
  • Cannot install software or make system-wide changes.
2.4 System Accounts
  • Used by system processes and services (e.g., root in Linux, SYSTEM in Windows).
  • Not meant for direct user login.

3. Managing User Accounts

3.1 Creating a User Account

Windows:

  1. Open Settings > Accounts.
  2. Click “Family & other users”.
  3. Click “Add someone else to this PC”.
  4. Follow the prompts to create an account with or without a Microsoft ID.

Linux:

  1. Open the terminal.
  2. Run the command

sudo adduser username

  1. Set a password and follow the prompts.

3.2 Modifying User Accounts

Windows:

  • Change account type:
    • Go to Control Panel > User Accounts.
    • Click Manage another account and change the account type.
  • Reset Password:
    • Open Settings > Accounts > Sign-in options.

Linux:

  • Change account details:
    nginx
     
    sudo usermod -l new_username old_username
  • Change user password:
    nginx
    sudo passwd username

3.3 Deleting a User Account

Windows:

  1. Go to Control Panel > User Accounts > Manage another account.
  2. Select the user and click “Delete the account”.
  3. Choose whether to keep or delete user files.

Linux:

  1. Remove the user but keep home directory:
    nginx
     
    sudo deluser username
  2. Remove the user and delete all files:
    arduino
    sudo deluser --remove-home username

4. Managing User Permissions and Roles

4.1 Setting Permissions in Windows

  • Right-click a file or folder > Properties > Security Tab.
  • Click Edit to modify permissions (Read, Write, Execute).

4.2 Setting Permissions in Linux

  • Change ownership:
    sql
     
    sudo chown user:group filename
  • Modify permissions using chmod:
    bash
     
    chmod 755 filename

5. Enforcing Security Policies

  • Use strong passwords and enable two-factor authentication.
  • Regularly update user privileges and remove inactive accounts.
  • Monitor system logs for unauthorized access.
 

System Configuration Services (Package) in Operating System.

Introduction.

  • System configuration services in an operating system manage system settings, hardware components, software installations, and various services.
  • These services ensure that the system runs efficiently by handling background processes, security policies, network configurations, and software dependencies.
  • System configuration services are essential for maintaining system stability, performance, and security.

1. Importance of System Configuration Services

  • Manage System Settings – Control hardware and software configurations.
  • Optimize Performance – Improve system efficiency by managing resources.
  • Ensure Security – Enforce security settings and access control.
  • Automate System Tasks – Handle scheduled jobs and background processes.
  • Manage Software Dependencies – Install and update necessary packages.

2. System Configuration Services in Different Operating Systems

2.1 Windows System Configuration (MSConfig)

Windows includes MSConfig (System Configuration Utility) to manage system settings.

Features of MSConfig:

  • Boot Configuration – Modify boot settings and troubleshoot startup issues.
  • Startup Services – Enable or disable background processes.
  • System Services – Manage Windows services and applications.
  • Tools Section – Access diagnostic tools for troubleshooting.

Accessing MSConfig:

  1. Press Win + R, type msconfig, and hit Enter.
  2. Modify system settings as required.

2.2 System Configuration in Linux

Linux uses configuration files and package management systems to handle system settings.

Key Components:

  • Systemd Services – Manage system processes and background services.
  • Configuration Files – Located in /etc/ for system-wide settings.
  • Package Managers – Handle software installation and updates.

Managing Services in Linux (Systemd & SysVinit):

  1. Check running services:
    bash
    systemctl list-units --type=service
  2. Start a service:
    pgsql
     
    sudo systemctl start service-name
  3. Enable a service at startup:
    pgsql
     
    sudo systemctl enable service-name
  4. Stop a service:
    arduino
     
    sudo systemctl stop service-name
  5. Disable a service:
    pgsql
     
    sudo systemctl disable service-name

Linux Configuration Files:

  • /etc/fstab – File system mount settings.
  • /etc/network/interfaces – Network configuration.
  • /etc/hostname – System hostname settings.
  • /etc/hosts – Local DNS resolution.

3. System Configuration Packages

System configuration often requires package management tools to install, update, and remove software.

3.1 Package Management in Windows

  • Windows Package Manager (winget):
    go
    winget install package-name
  • Chocolatey Package Manager:
    go
     
    choco install package-name

3.2 Package Management in Linux

  • APT (Debian/Ubuntu):
    go
     
    sudo apt install package-name
  • YUM/DNF (RHEL/Fedora):
    go
     
    sudo dnf install package-name
  • Pacman (Arch Linux):
    go
    sudo pacman -S package-name

4. Network Configuration Services

System configuration services also manage network settings.

Windows Network Configuration:

  • Configure IP settings using the Control Panel or netsh command.
  • Enable/Disable network adapters:
    vbnet
     
    netsh interface set interface "Wi-Fi" admin=disable

Linux Network Configuration:

  • Configure network interfaces using /etc/network/interfaces.
  • Restart network service:
    nginx
     
    sudo systemctl restart networking

5. Security and Firewall Management

System configuration services help enforce security settings.

Windows Firewall Management:

  • Open Windows Security > Firewall & network protection.
  • Allow or block applications through the firewall.
Linux Firewall Management (UFW & IPTables):
  • Enable UFW firewall:
    bash
     
    sudo ufw enable
  • Allow an application through the firewall:
    bash
    sudo ufw allow 22/tcp

 

Exit mobile version