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
Mastering Ubuntu Server: Explore the versatile, powerful Linux Server distribution Ubuntu 22.04 with this comprehensive guide Rating: 0 out of 5 stars0 ratingsLinux System Programming Techniques: Become a proficient Linux system programmer using expert recipes and techniques Rating: 0 out of 5 stars0 ratingsLinux - a Secure Personal Computer for Beginners Rating: 0 out of 5 stars0 ratingsLinux For Beginners: The Comprehensive Guide To Learning Linux Operating System And Mastering Linux Command Line Like A Pro Rating: 0 out of 5 stars0 ratingsFundamentals of Linux: Explore the essentials of the Linux command line Rating: 0 out of 5 stars0 ratingsActive Directory and PowerShell for Jobseekers: Learn how to create, manage, and secure user accounts (English Edition) Rating: 0 out of 5 stars0 ratingsBecome An Ethical Hacker That Can Hack Computer Systems And Secure Them Like Security Experts Rating: 0 out of 5 stars0 ratingsCentOS High Performance Rating: 0 out of 5 stars0 ratingsMastering Linux Administration: A Comprehensive Guide: The IT Collection Rating: 5 out of 5 stars5/5Linux: A complete guide to Linux command line for beginners, and how to get started with the Linux operating system! Rating: 0 out of 5 stars0 ratingsThe Ultimate Kali Linux Book: Harness Nmap, Metaspolit, Aircrack-ng, and Empire for cutting-edge pentesting Rating: 0 out of 5 stars0 ratingsPractical Data Science with Python: Learn tools and techniques from hands-on examples to extract insights from data Rating: 0 out of 5 stars0 ratingsPHP and MySQL Web Development All-in-One Desk Reference For Dummies Rating: 0 out of 5 stars0 ratingsCertified Ethical Hacker (CEH v12) Exam Preparation Rating: 0 out of 5 stars0 ratingsHands-On Ethical Hacking Tactics: Strategies, tools, and techniques for effective cyber defense Rating: 0 out of 5 stars0 ratingsMicrosoft PowerShell, VBScript and JScript Bible Rating: 0 out of 5 stars0 ratingsLinux Hacking 101: A Beginner’s Guide to Ethical Hacking with Linux and Kali Linux Rating: 0 out of 5 stars0 ratingsMicrosoft Access 2021 Programming Pocket Primer: A Comprehensive Guide to Mastering Access VBA Rating: 0 out of 5 stars0 ratingsBasics of Programming: A Comprehensive Guide for Beginners: Essential Coputer Skills, #1 Rating: 0 out of 5 stars0 ratingsMastering Data Science: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsCybersecurity - Attack and Defense Strategies: Infrastructure security with Red Team and Blue Team tactics Rating: 5 out of 5 stars5/5Ian Talks Unix Tools A-Z: ToolsAtoZ, #2 Rating: 0 out of 5 stars0 ratingsInstant Ubuntu: Your complete guide to making the switch to Ubuntu Rating: 4 out of 5 stars4/5Exploring Chromebook - 2023 Edition: The Illustrated, Practical Guide to using Chromebook Rating: 0 out of 5 stars0 ratingsASP.NET 8 Best Practices: Explore techniques, patterns, and practices to develop effective large-scale .NET web apps Rating: 0 out of 5 stars0 ratingsHow Hackers Steal Wi-Fi Passwords and How to Stop Them: Hacking, #3 Rating: 0 out of 5 stars0 ratingsPHP 8 Revealed: Use Attributes, the JIT Compiler, Union Types, and More for Web Development Rating: 0 out of 5 stars0 ratingsDevOps Revolution: Transforming Software Delivery for High-Performance Teams Rating: 0 out of 5 stars0 ratingsLPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 Rating: 0 out of 5 stars0 ratings
Operating Systems For You
Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5The Mac Terminal Reference and Scripting Primer Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Windows 11 For Dummies Rating: 0 out of 5 stars0 ratingsApple Card and Apple Pay: A Ridiculously Simple Guide to Mobile Payments 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 ratingsmacOS Sonoma For Dummies Rating: 0 out of 5 stars0 ratingsBash Command Line Pro Tips Rating: 5 out of 5 stars5/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsTor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsWindows 11 All-in-One For Dummies Rating: 5 out of 5 stars5/5The Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5Networking for System Administrators: IT Mastery, #5 Rating: 5 out of 5 stars5/5iPhone For Dummies Rating: 0 out of 5 stars0 ratingsLinux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsHacking for Beginners: Mastery Guide to Learn and Practice the Basics of Computer and Cyber Security Rating: 0 out of 5 stars0 ratingsMake Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5XDA Developers' Android Hacker's Toolkit: The Complete Guide to Rooting, ROMs and Theming Rating: 2 out of 5 stars2/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Ultimate SwiftUI Handbook for iOS Developers: A complete guide to native app development for iOS, macOS, watchOS, tvOS, and visionOS Rating: 0 out of 5 stars0 ratingsUbuntu: 101 Tips & Tricks Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsPowerShell: A Beginner's Guide to Windows PowerShell Rating: 4 out of 5 stars4/5Linux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Raspberry Pi Cookbook for Python Programmers 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