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)
Download the software from the official website.
Double-click the
.exe
or.msi
file to launch the installer.Follow the installation wizard:
Accept terms and conditions.
Choose the installation directory.
Select additional components (if required).
Click “Install” and wait for the process to complete.
Open the software from the Start Menu or Desktop shortcut.
Method 2: Using Windows Package Managers (Chocolatey, Winget)
Open Command Prompt (cmd) or PowerShell as Administrator.
Install Chocolatey or Winget (if not already installed).
Run the command:
nginx
choco install software-name
or
nginxwinget install software-name
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:
Open the Terminal.
Update the package repository:
nginxsudo apt update && sudo apt upgrade # Ubuntu/Debian sudo dnf update # Fedora sudo pacman -Syu # Arch Linux
Install the software using the package manager:
nginxsudo apt install software-name # Ubuntu/Debian sudo dnf install software-name # Fedora sudo pacman -S software-name # Arch Linux
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:
Download the source code (
.tar.gz
or.zip
) from the official website.Extract the files:
pgsqltar -xvzf software-name.tar.gz cd software-name
Install dependencies (if required).
Compile and install:
go./configure make sudo make install
Run the software using the terminal.
Method 3: Using Snap, Flatpak, or AppImage
Install Snap (if not already installed):
nginxsudo apt install snapd
Then install software:
nginxsudo snap install software-name
Install Flatpak:
nginxsudo apt install flatpak
Then install software:
nginxflatpak install software-name
AppImage:
Download the
.AppImage
file.Make it executable:
bashchmod +x software.AppImage
Run the software:
bash
./software.AppImage
2.3 Installing Open Source Software on macOS
Method 1: Using Homebrew (Package Manager)
Open Terminal.
Install Homebrew (if not installed):
bash/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install software:
nginx
brew install software-name
Method 2: Using .dmg or .pkg Files
Download the software from the official website.
Open the
.dmg
file and drag the application to the Applications folder.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:
Open Settings > Accounts.
Click “Family & other users”.
Click “Add someone else to this PC”.
Follow the prompts to create an account with or without a Microsoft ID.
Linux:
- Open the terminal.
- Run the command
sudo adduser username
- 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:
nginxsudo usermod -l new_username old_username
Change user password:
nginx
sudo passwd username
3.3 Deleting a User Account
Windows:
Go to Control Panel > User Accounts > Manage another account.
Select the user and click “Delete the account”.
Choose whether to keep or delete user files.
Linux:
Remove the user but keep home directory:
nginxsudo deluser username
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:
sqlsudo 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:
Press
Win + R
, typemsconfig
, and hit Enter.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):
Check running services:
bashsystemctl list-units --type=service
Start a service:
pgsqlsudo systemctl start service-name
Enable a service at startup:
pgsqlsudo systemctl enable service-name
Stop a service:
arduinosudo systemctl stop service-name
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):
gowinget install package-name
Chocolatey Package Manager:
go
choco install package-name
3.2 Package Management in Linux
APT (Debian/Ubuntu):
gosudo apt install package-name
YUM/DNF (RHEL/Fedora):
gosudo 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:
bashsudo ufw enable
Allow an application through the firewall:
bash
sudo ufw allow 22/tcp