Linux Basics for SysAdmin: Learn core linux concepts and command-line skills to kickstart your system administration career
By Ryan Juan
()
About this ebook
For students, aspiring IT specialists, and working professionals, "Linux Basics for SysAdmin" is a great starting point for learning the fundamentals of Linux, including the command line and all the tools and commands needed to manage enterprise systems.
At
Related to Linux Basics for SysAdmin
Related ebooks
LPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 Rating: 0 out of 5 stars0 ratingsMastering Linux Administration: A Comprehensive Guide: The IT Collection Rating: 5 out of 5 stars5/5LPIC-1 Primer Rating: 4 out of 5 stars4/5CompTIA Linux+ and LPIC Practice Tests: Exams LX0-103/LPIC-1 101-400, LX0-104/LPIC-1 102-400, LPIC-2 201, and LPIC-2 202 Rating: 0 out of 5 stars0 ratingsMastering Linux System Administration Rating: 0 out of 5 stars0 ratingsLPI Linux Essentials Study Guide: Exam 010 v1.6 Rating: 3 out of 5 stars3/5LINUX FOR NOVICES: A Beginner's Guide to Mastering the Linux Operating System (2023) Rating: 0 out of 5 stars0 ratingsLinux for Beginners: How to Master the Linux Operating System and Command Line form Scratch Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Study Guide: Exam XK0-005 Rating: 0 out of 5 stars0 ratingsMastering Linux: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Practice Tests: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsInstant Debian - Build a Web Server Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Practice Tests: Exam XK0-005 Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Work with the Command-line: To Manage Files and Directories in Ubuntu Rating: 5 out of 5 stars5/5SELinux System Administration - Second Edition Rating: 0 out of 5 stars0 ratingsProfessional Guide to Linux System Programming: Understanding and Implementing Advanced Techniques Rating: 0 out of 5 stars0 ratingsLinux: A Comprehensive Guide to Linux Operating System and Command Line Rating: 0 out of 5 stars0 ratingsLinux Interview Questions: Open Source Operating Systems Interview Questions, Answers, and Explanations Rating: 5 out of 5 stars5/5Linux For Beginners: The Comprehensive Guide To Learning Linux Operating System And Mastering Linux Command Line Like A Pro Rating: 0 out of 5 stars0 ratingsSELinux System Administration Rating: 0 out of 5 stars0 ratingsExpert Linux Development: Mastering System Calls, Filesystems, and Inter-Process Communication Rating: 0 out of 5 stars0 ratingsLPIC-1 Linux Professional Institute Certification Study Guide: Exam 101-500 and Exam 102-500 Rating: 0 out of 5 stars0 ratingsLPI Linux Certification Questions: LPI Linux Interview Questions, Answers, and Explanations Rating: 4 out of 5 stars4/5LPIC-1 Linux Professional Institute Certification Practice Tests: Exam 101-500 and Exam 102-500 Rating: 0 out of 5 stars0 ratingsCompTIA Linux+/LPIC-1: Training and Exam Preparation Guide (Exam Codes: LX0-103/101-400 and LX0-104/102-400) Rating: 0 out of 5 stars0 ratingsLinux Mastery: A Comprehensive Guide for Beginners and Beyond Rating: 0 out of 5 stars0 ratingsRHCSA Red Hat Enterprise Linux 8: Training and Exam Preparation Guide (EX200), First Edition Rating: 4 out of 5 stars4/5Linux System Administrator Interview Questions You'll Most Likely Be Asked Rating: 0 out of 5 stars0 ratings
Operating Systems For You
The Darknet Superpack Rating: 0 out of 5 stars0 ratingsThe Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5The Mac Terminal Reference and Scripting Primer Rating: 4 out of 5 stars4/5Instant Ubuntu Rating: 4 out of 5 stars4/5Mastering Windows 365: Deploy and Manage Cloud PCs and Windows 365 Link devices, Copilot with Intune, and Intune Suite Rating: 0 out of 5 stars0 ratingsiPhone Unlocked Rating: 0 out of 5 stars0 ratingsXDA Developers' Android Hacker's Toolkit: The Complete Guide to Rooting, ROMs and Theming Rating: 2 out of 5 stars2/5Hacking for Beginners: Mastery Guide to Learn and Practice the Basics of Computer and Cyber Security Rating: 0 out of 5 stars0 ratingsHacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5CompTIA A+ Complete Study Guide: Core 1 Exam 220-1101 and Core 2 Exam 220-1102 Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsOneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Bash Command Line Pro Tips Rating: 5 out of 5 stars5/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5macOS Sonoma For Dummies Rating: 0 out of 5 stars0 ratingsUbuntu Linux Bible Rating: 0 out of 5 stars0 ratingsMacBook Pro User Manual: 2022 MacBook Pro User Guide for beginners and seniors to Master Macbook Pro like a Pro Rating: 0 out of 5 stars0 ratingsLinux Basics for Hackers: Getting Started with Networking, Scripting, and Security in Kali Rating: 3 out of 5 stars3/5Active Directory For Dummies Rating: 0 out of 5 stars0 ratingsiPhone For Dummies Rating: 0 out of 5 stars0 ratingsPowerShell: A Beginner's Guide to Windows PowerShell Rating: 4 out of 5 stars4/5Practical Digital Forensics Rating: 0 out of 5 stars0 ratingsWindows 11 For Dummies Rating: 0 out of 5 stars0 ratingsExploring Apple Mac - Sequoia Edition: The Illustrated, Practical Guide to Using MacOS Rating: 0 out of 5 stars0 ratings
Reviews for Linux Basics for SysAdmin
0 ratings0 reviews
Book preview
Linux Basics for SysAdmin - Ryan Juan
Linux Basics for SysAdmin
Learn core linux concepts and command-line skills to kickstart your system administration career
Ryan Juan
Preface
For students, aspiring IT specialists, and working professionals, Linux Basics for SysAdmin
is a great starting point for learning the fundamentals of Linux, including the command line and all the tools and commands needed to manage enterprise systems.
At first, you are introduced to the Linux environment, with a focus on browsing the filesystem, using basic commands, managing files and directories, and becoming acquainted with the shell. You'll also learn about package management and how to handle system startup and shutdown efficiently.
After that, you'll learn all about system configuration files, 'systemd' for managing system services, crontab for job scheduling, and 'at' and 'batch' for automating processes. You will also learn about system performance monitoring, log files, backup and restore procedures, disk partitioning, and remote management via SSH.
Afterwards, the book delves into topics such as dependency management, system hardware configuration, kernel upgrades, and device driver management, as well as package management with 'apt' and 'yum'. You'll also learn how to create and manage repositories, and install and setup virtual machines with VirtualBox. In the end, the book covers a wide range of topics, including creating and managing user accounts, editing user profiles, setting ownership and permissions for files, using ACLs, managing user sessions, configuring sudo for administrative tasks, implementing password policies, working with PAM, and managing group memberships.
In this book you will learn how to:
Master essential Linux commands to efficiently navigate and manage the system's file structure.
Gain proficiency in user and group management to ensure secure access control and permissions.
Learn to configure and manage system services with systemd for streamlined service administration.
Implement and enforce robust password policies for enhanced security and user account protection.
Understand and utilize package management tools for seamless software installation.
Set up and manage virtual machines with VirtualBox to create isolated, reproducible development environments.
Use Access Control Lists (ACLs) to fine-tune file permissions beyond the standard Unix model.
Schedule and automate tasks using cron, at, and batch to improve system efficiency and reliability.
Monitor system performance and logs to proactively identify and address potential issues.
Securely configure and use SSH for remote management and administration of Linux systems.
An understanding of the basics of Linux system administration will be yours by the time you finish this book.
Also, there is a companion book called Linux Advanced for SysAdmin
for anyone who want to learn more advanced Linux techniques, by the same Author ‘Ryan Juan’. Concepts like advanced database management, security configuration, network management, system monitoring, and advanced operations including deployments, load balancing, and working with Kubernetes are the main focus of this follow-up book. Each of these books, taken together, provide a solid foundation and advanced expertise for both aspiring and practicing Linux system administrators.
Prologue
You have arrived at Linux Basics for SysAdmin,
a book that will teach you the ropes of Linux so that you may confidently administer Linux systems. Whether you're an experienced IT professional looking to hone your skills, a student eager to learn Linux, or someone in between, this book will cover all you need to know to become a competent system administrator.
A large number of computers, desktops, and mobile devices throughout the globe run Linux because of its flexibility and power. It is a priceless asset to the IT sector due to its open-source nature, robustness, and adaptability. Understanding the fundamental concepts that make Linux systems secure, efficient, and dependable is more important than simply knowing commands and configurations if you want to become an expert Linux user.
Beginning with the fundamentals, this book will provide you with the groundwork you need to become proficient with Linux. Up and Running with Linux Systems,
the first chapter, provides an overview of the Linux environment. A fundamental understanding of the shell, file and directory management, and command syntax will be covered. We also go over the basics of system starting and shutdown, managing packages, and the utilities that are needed for Linux administration.
Next, in Chapter 2, Managing Linux Systems,
we will explore system management in more detail. Discover the ins and outs of configuration files, learn how to use systemd to control services, crontab to schedule activities, and monitor system performance. Partitioning disks, managing log files, and SSH-based remote administration are all covered in this chapter.
When it comes to managing software and hardware, Chapter 3 is where it's at. This chapter will teach you the ins and outs of using apt and yum for package management, dealing with dependencies, configuring your system's hardware, and upgrading the kernel. Docker and VirtualBox, two popular tools for creating and managing virtual machines, are also covered in this chapter.
Chapter 4, User and Permission Management,
discusses how to manage users and permissions. Access Control Lists (ACLs), file ownership and permission settings, user profile editing, and account creation and management are all part of what you can expect. You will also be responsible for managing group memberships, working with Pluggable Authentication Modules (PAM), implementing password restrictions, configuring sudo, and user sessions.
This book will provide you the core concepts of Linux system administration practically, so you can start managing your systems with confidence. Starting here will go you far in the IT career path you desire by making you an expert Linux system administrator.
Copyright © 2024 by GitforGits
All rights reserved. This book is protected under copyright laws and no part of it may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without the prior written permission of the publisher. Any unauthorized reproduction, distribution, or transmission of this work may result in civil and criminal penalties and will be dealt with in the respective jurisdiction at anywhere in India, in accordance with the applicable copyright laws.
Published by: GitforGits
Publisher: Sonal Dhandre
www.gitforgits.com
Printed in India
First Printing: May 2024
Cover Design by: Kitten Publishing
For permission to use material from this book, please contact GitforGits at [email protected].
Content
Preface
GitforGits
Acknowledgement
Chapter I: Up and Running with Linux Systems
Overview
Understanding Linux Ubuntu
Navigating the Linux Filesystem
Basic Linux Commands
Network Configuration and Troubleshooting
‘ip’ and ‘ifconfig’
‘mtr’
File and Text Processing
‘find’
‘awk’
Network Monitoring and Diagnostics
‘tcpdump’
‘netstat’
‘nslookup’
System and Process Management
‘sudo’
‘tmux’
‘lsns’
‘pkill’
Email and Web Requests
‘mail’
‘curl’
‘watch’
Sample Program: Putting All Commands Together
Network Configuration and Diagnostics
Searching and Processing Files
Capturing and Analyzing Network Traffic
DNS Queries and Network Statistics
System and Process Management
Email and Web Requests
Monitoring System Changes
File and Directory Management
Setting up the Directory Structure
Creating Files and Directories
Accessing Hidden Files and Directories
Viewing File and Directory Permissions
Changing File and Directory Permissions
Setting Ownership
Accessing Secured Files
Understanding Permissions and Access Control
Managing Large Files and Directories
Moving and Copying Files
Deleting Files and Directories
Finding Files Based on Permissions
Working with Links
Archiving and Compressing Files
File Integrity and Security
Scheduling Regular Tasks
Monitoring File and Directory Changes
Introduction to Shell
Purpose of Shell
Introducing Bash
Basic Bash Commands
Navigating Directories
Listing Directory Contents
Creating and Deleting Files
Copying and Moving Files
Using Command History
Tab Completion
Bash Variables
Bash Scripting
Conditional Statements
Loops in Bash
Functions in Bash
Basics of Package Management
Purpose of Managing Packages
Updating Package Lists and Upgrading Software
Installing Packages
Viewing Installed Packages
Deleting Packages
Finding Packages
Working with Repositories
Pinning Packages
Sample Program: Managing Packages for AlphaProject
System Startup and Shutdown
Shutting Down and Rebooting the System
Booting the System
Automating Startup and Shutdown
Managing Specific Services
Starting and Stopping Services
Enabling and Disabling Services at Boot
Checking Service Status
Sample Program: Managing AlphaProject Services
Scheduling Service Management with Cron
Logging and Monitoring Services
Managing Processes
Stages of a Process
Displaying Running Processes
Starting and Terminating Processes
Adjusting Process Priority
Suspending and Resuming Processes
Monitoring Process Activity
Sample Program: Managing Processes for AlphaProject
Starting a Web Server
Running a Background Script
Monitoring Web Server Activity
Terminating a Misbehaving Process
Changing the Priority of a Backup Process
Suspending and Resuming Long-Running Compilation
Automating Process Management with Cron
Monitoring Processes with ‘ps’ and ‘top’
Tracing a Problematic Process
Using ‘lsof’ to Check Open Files
Sample Workflow: Handling High CPU Usage
Identify the High CPU Process
Adjust the Priority
Monitor the Process
Terminate If Necessary
Accessing and using Linux Utilities
Role of Utilities
Common Utilities for AlphaProject
File and Directory Management Utilities
‘cp’, ‘mv’, and ‘rm’
‘find’
Text Processing Utilities
‘grep’
‘sed’
‘awk’
Network Utilities
‘ping’
‘traceroute’
‘netstat’
‘curl’
System Monitoring Utilities
‘top’ and ‘htop’
‘df’ and ‘du’
Archiving and Compression Utilities
‘tar’, ‘gzip’, and ‘zip’
Disk Usage and Partition Management Utilities
‘fdisk’ and ‘lsblk’
Sample Program: Using Utilities in AlphaProject
File Backup and Management
Log Analysis
Configuration Management
Network Diagnostics
System Monitoring
Disk Space Management
Archiving Project Data
Downloading Resources
Disk Partition Analysis
Summary
Chapter II: Managing Linux Systems
Overview
Getting around System Configuration Files
Characteristics of System Configuration Files
Categories of Configuration Files
Customizing Configuration Files
Editing Configuration Files
Backup Configuration Files
Understanding Configuration Syntax
Sample Program: Customizing Configuration Files
Customizing Network Settings
Configuring SSH
Setting up User Accounts
Configuring Apache Web Server
Managing Services
Configuring User and Group Permissions
Setting System Locale
Automating Configuration Changes
Managing System Services with ‘systemd’
‘systemd’ Components
Managing System Services with systemd
Viewing Service Status
Starting and Stopping Services
Restarting and Reloading Services
Enabling and Disabling Services at Boot
Checking All Services
Analyzing Boot Performance
Managing Dependencies
Creating Custom Service Units
Logging with journalctl
Handling Service Failures
Sample Program: Using ‘systemd’ to Manage AlphaProject Services
Using ‘crontab’
Introduction to Cron Utility
Understanding crontab
Sample Program: Using crontab in AlphaProject
Setting up a Backup Job
Cleaning up Temporary Files
Monitoring System Health
Sending Email Notifications
Rotating Logs
Custom Scheduling with Step Values
Viewing and Managing Cron Jobs
Scheduling Tasks with ‘at’ and ‘batch’
Introduction to ‘at’ and ‘batch’
Using at and batch in AlphaProject
Scheduling One-Time Tasks with at
Scheduling Tasks with Relative Time
Scheduling Tasks with Specific Dates
Using batch for System Load-Dependent Tasks
Combining at and batch with Other Utilities
Automating System Health Checks
Managing and Viewing Logs
Monitoring System Performance
Key Metrics to Monitor
System Performance Monitoring Tools
‘top’
‘vnstat’
‘nagios’
‘iftop’
‘psacct’
‘iostat’
‘netstat’
Sample Program: Monitoring Tools in AlphaProject
Monitoring CPU and Memory Usage
Tracking Network Traffic
Comprehensive System Monitoring with Nagios
Real-Time Network Monitoring with iftop
Detailed Process Accounting with psacct
Disk and I/O Statistics with iostat
Network Connections and Statistics with netstat
Log Files and System Logging
What Can Be Logged in Linux
Understanding Syslogs
Managing Syslogs with rsyslog
Installing and Configuring rsyslog
Understanding the rsyslog Configuration
Basic Configuration Example
Customizing System Logs for AlphaProject
Accessing and Analyzing Logs
Setting up Log Rotation
Remote Logging
Monitoring Logs with Logwatch
Sample Program: Logging Messages
Custom Application Logging
Log Rotation for Application Logs
Remote Logging Setup
Backing up and Restoring Systems
‘rsync’
Key Features of rsync
Using rsync for AlphaProject
Installing rsync
Backing up Data with rsync