Administration Guide Administration Guide SUSE Linux Enterprise Server 15 SP1
Total Page:16
File Type:pdf, Size:1020Kb
SUSE Linux Enterprise Server 15 SP1 Administration Guide Administration Guide SUSE Linux Enterprise Server 15 SP1 Covers system administration tasks like maintaining, monitoring and customizing an initially installed system. Publication Date: September 24, 2021 SUSE LLC 1800 South Novell Place Provo, UT 84606 USA https://documentation.suse.com Copyright © 2006– 2021 SUSE LLC and contributors. All rights reserved. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”. For SUSE trademarks, see https://www.suse.com/company/legal/ . All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its aliates. Asterisks (*) denote third-party trademarks. All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its aliates, the authors nor the translators shall be held liable for possible errors or the consequences thereof. Contents About This Guide xxii 1 Available Documentation xxiii 2 Giving Feedback xxv 3 Documentation Conventions xxv 4 Product Life Cycle and Support xxvii Support Statement for SUSE Linux Enterprise Server xxviii • Technology Previews xxix I COMMON TASKS 1 1 Bash and Bash Scripts 2 1.1 What is “The Shell”? 2 Bash Configuration Files 2 • The Directory Structure 5 1.2 Writing Shell Scripts 9 1.3 Redirecting Command Events 10 1.4 Using Aliases 11 1.5 Using Variables in Bash 11 Using Argument Variables 13 • Using Variable Substitution 13 1.6 Grouping and Combining Commands 14 1.7 Working with Common Flow Constructs 15 The if Control Command 15 • Creating Loops with the for Command 16 1.8 For More Information 16 iii Administration Guide 2 sudo 17 2.1 Basic sudo Usage 17 Running a Single Command 17 • Starting a Shell 18 • Environment Variables 19 2.2 Configuring sudo 19 Editing the Configuration Files 20 • Basic sudoers Configuration Syntax 20 • Rules in sudoers 22 2.3 Common Use Cases 24 Using sudo without root Password 24 • Using sudo with X.Org Applications 25 2.4 More Information 26 3 YaST Online Update 27 3.1 The Online Update Dialog 28 3.2 Installing Patches 29 3.3 Automatic Online Update 30 4 YaST 33 4.1 Advanced Key Combinations 33 5 YaST in Text Mode 35 5.1 Navigation in Modules 36 5.2 Advanced Key Combinations 38 5.3 Restriction of Key Combinations 38 5.4 YaST Command Line Options 39 Installing Packages from the Command Line 39 • Starting Individual Modules 39 • Command Line Parameters of YaST Modules 40 iv Administration Guide 6 Managing Software with Command Line Tools 64 6.1 Using Zypper 64 General Usage 64 • Using Zypper Subcommands 66 • Installing and Removing Software with Zypper 66 • Updating Software with Zypper 71 • Identifying Processes and Services Using Deleted Files 74 • Managing Repositories with Zypper 76 • Querying Repositories and Packages with Zypper 78 • Showing Life Cycle Information 80 • Configuring Zypper 81 • Troubleshooting 81 • Zypper Rollback Feature on Btrfs File System 82 • For More Information 82 6.2 RPM—the Package Manager 82 Verifying Package Authenticity 83 • Managing Packages: Install, Update, and Uninstall 83 • Delta RPM Packages 85 • RPM Queries 85 • Installing and Compiling Source Packages 88 • Compiling RPM Packages with build 90 • Tools for RPM Archives and the RPM Database 91 7 System Recovery and Snapshot Management with Snapper 92 7.1 Default Setup 93 Types of Snapshots 94 • Directories That Are Excluded from Snapshots 94 • Customizing the Setup 95 7.2 Using Snapper to Undo Changes 99 Undoing YaST and Zypper Changes 100 • Using Snapper to Restore Files 105 7.3 System Rollback by Booting from Snapshots 107 Snapshots after Rollback 109 • Accessing and Identifying Snapshot Boot Entries 109 • Limitations 111 7.4 Enabling Snapper in User Home Directories 112 Installing pam_snapper and Creating Users 113 • Removing Users 113 • Manually Enabling Snapshots in Home Directories 114 7.5 Creating and Modifying Snapper Configurations 114 Managing Existing Configurations 116 v Administration Guide 7.6 Manually Creating and Managing Snapshots 119 Snapshot Metadata 119 • Creating Snapshots 121 • Modifying Snapshot Metadata 122 • Deleting Snapshots 122 7.7 Automatic Snapshot Clean-Up 124 Cleaning Up Numbered Snapshots 124 • Cleaning Up Timeline Snapshots 126 • Cleaning Up Snapshot Pairs That Do Not Differ 127 • Cleaning Up Manually Created Snapshots 128 • Adding Disk Quota Support 128 7.8 Showing Exclusive Disk Space Used by Snapshots 129 7.9 Frequently Asked Questions 131 8 Live kernel patching with KLP 133 8.1 Advantages of Kernel Live Patching 133 8.2 Kernel Live Patching overview 133 Kernel Live Patching scope 135 • Kernel Live Patching limitations 135 8.3 Activating Kernel Live Patching using YaST 135 8.4 Activating Kernel Live Patching from the command line 136 8.5 Performing Kernel Live Patching 137 Checking expiration date of the live patch 137 9 Transactional Updates 138 9.1 Limitations of Technical Preview 138 9.2 Enabling transactional-update 140 9.3 Managing Automatic Updates 140 9.4 The transactional-update Command 141 9.5 Troubleshooting 143 vi Administration Guide 10 Remote Graphical Sessions with VNC 144 10.1 The vncviewer Client 144 Connecting Using the vncviewer CLI 144 • Connecting Using the vncviewer GUI 145 • Notification of Unencrypted Connections 145 10.2 Remmina: the Remote Desktop Client 145 Installation 145 • Main Window 146 • Adding Remote Sessions 146 • Starting Remote Sessions 148 • Editing, Copying, and Deleting Saved Sessions 149 • Running Remote Sessions from the Command Line 149 10.3 Configuring One-time Sessions on the VNC Server 150 Available Configurations 151 • Initiating a One-time VNC Session 152 • Configuring One-time VNC Sessions 152 10.4 Configuring Persistent VNC Server Sessions 153 VNC Session Initiated Using vncserver 154 • VNC Session Initiated Using vncmanager 155 10.5 Configuring Encryption on the VNC Server 158 11 File Copying with RSync 161 11.1 Conceptual Overview 161 11.2 Basic Syntax 161 11.3 Copying Files and Directories Locally 162 11.4 Copying Files and Directories Remotely 163 11.5 Configuring and Using an Rsync Server 163 11.6 For More Information 166 II BOOTING A LINUX SYSTEM 167 12 Introduction to the Boot Process 168 12.1 Terminology 168 vii Administration Guide 12.2 The Linux Boot Process 169 The Initialization and Boot Loader Phase 169 • The Kernel Phase 170 • The init on initramfs Phase 173 • The systemd Phase 175 13 UEFI (Unified Extensible Firmware Interface) 176 13.1 Secure Boot 176 Implementation on SUSE Linux Enterprise Server 177 • MOK (Machine Owner Key) 179 • Booting a Custom Kernel 180 • Using Non-Inbox Drivers 182 • Features and Limitations 183 13.2 For More Information 184 14 The Boot Loader GRUB 2 185 14.1 Main Differences between GRUB Legacy and GRUB 2 185 14.2 Configuration File Structure 185 The File /boot/grub2/grub.cfg 186 • The File /etc/default/ grub 187 • Scripts in /etc/grub.d 190 • Mapping between BIOS Drives and Linux Devices 191 • Editing Menu Entries during the Boot Procedure 192 • Setting a Boot Password 193 14.3 Configuring the Boot Loader with YaST 194 Boot Loader Location and Boot Code Options 196 • Adjusting the Disk Order 197 • Configuring Advanced Options 198 14.4 Differences in Terminal Usage on IBM Z 201 Limitations 201 • Key Combinations 202 14.5 Helpful GRUB 2 Commands 204 14.6 More Information 205 15 The systemd Daemon 206 15.1 The systemd Concept 206 What Is systemd 206 • Unit File 207 15.2 Basic Usage 208 Managing Services in a Running System 208 • Permanently Enabling/ Disabling Services 210 viii Administration Guide 15.3 System Start and Target Management 212 Targets Compared to Runlevels 212 • Debugging System Start- Up 215 • System V Compatibility 218 15.4 Managing Services with YaST 219 15.5 Customization of systemd 220 Customizing Unit Files 220 • Creating “Drop-in” Files 222 • Creating Custom Targets 222 15.6 Advanced Usage 223 Cleaning Temporary Directories 223 • System Log 224 • Snapshots 224 • Loading Kernel Modules 224 • Performing Actions before Loading a Service 225 • Kernel Control Groups (cgroups) 226 • Terminating Services (Sending Signals) 227 • Important Notes on the D-Bus Service 227 • Debugging Services 228 15.7 More Information 229 III SYSTEM 230 16 32-Bit and 64-Bit Applications in a 64-Bit System Environment 231 16.1 Runtime Support 231 16.2 Kernel Specifications 232 17 journalctl: Query the systemd Journal 233 17.1 Making the Journal Persistent 233 17.2 journalctl Useful Switches 234 17.3 Filtering the Journal Output 235 Filtering Based on a Boot Number 235 • Filtering Based on Time Interval 235 • Filtering Based on Fields 236 17.4 Investigating systemd Errors 237 ix Administration Guide 17.5 Journald Configuration 238 Changing the Journal Size Limit 238 • Forwarding the Journal to /dev/ ttyX 238 • Forwarding the Journal to Syslog Facility 239 17.6 Using YaST to Filter the systemd Journal 239 17.7 Viewing Logs in GNOME 240 18 update-alternatives: Managing Multiple Versions of Commands and Files 241 18.1 Overview 241 18.2 Use Cases 243 18.3 Getting an Overview of Alternatives 243 18.4 Viewing Details on Specific Alternatives 243 18.5 Setting the Default Version of Alternatives 244 18.6 Installing Custom