31,19 €
Linux kernel development has been the worlds largest collaborative project to date. With this practical guide, you will learn Linux through one of its most popular and stable distributions.
This book will introduce you to essential Linux skills using CentOS 7. It describes how a Linux system is organized, and will introduce you to key command-line concepts you can practice on your own. It will guide you in performing basic system administration tasks and day-to-day operations in a Linux environment.
You will learn core system administration skills for managing a system running CentOS 7 or a similar operating system, such as RHEL 7, Scientific Linux, and Oracle Linux. You will be able to perform installation, establish network connectivity and user and process management, modify file permissions, manage text files using the command line, and implement basic security administration after covering this book.
By the end of this book, you will have a solid understanding of working with Linux using the command line.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 301
Veröffentlichungsjahr: 2018
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Pavan RamchandaniAcquisition Editor: Siddharth MandalContent Development Editor: Kirk DsouzaTechnical Editor: Adya AnandCopy Editor: Safis EditingProject Coordinator:Hardik BhindeProofreader: Safis EditingIndexer: Rekha NairGraphics:Alishon MendonsaProduction Coordinator:Tom Scaria
First published: December 2018
Production reference: 1241218
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78934-487-5
www.packtpub.com
To the two most beautiful ladies and pillars of my life, my mother, Mrs. Vijay Lata, and my better half, Reetu.
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools, to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and, as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Shiwang Kalkhanda (RHCA, RHCSS, MCSE) is a Linux geek and consultant with expertise in the automation of infrastructure deployment and management. He has more than 10 years' experience in security, system, and network administration, and training on open source tech. For most of his automation work, he uses Shell Scripting, Python, and Go. He holds a master's and a bachelor's degree in computer applications. He enjoys traveling and spending time with his children. He is also the author of a book on text processing utilities in Unix-like environments, Learning Awk Programming.
Denis Fateyev holds a master's degree in computer science and has been working with Linux for more than 10 years (mostly with Red Hat and CentOS). He currently works as a Perl and Go system programmer and DevOps for a small international company. For Packt Publishing, he has reviewed several books, mostly related to CentOS, DevOps, and high-availability technologies, including GitLab Cookbook, CentOS High Availability, and CentOS High Performance. A keen participant in the open source community, he is a package maintainer in the Fedora project. Foreign languages (German, Spanish) and linguistics are other passions of his. He can be reached at [email protected].
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
CentOS Quick Start Guide
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Conventions used
Get in touch
Reviews
Getting Started with CentOS 7
Preparing to install CentOS 7
Getting the right hardware
Getting the software
Finalizing server setup details
Performing manual installation
Accessing the command line using the console
Starting a Terminal
Command-line syntax and structure
Exiting the shell
Introducing the Bash shell
Bash shell and command execution
Tab completion
Command-line editing shortcuts
The history command
Command aliases
Listing current aliases
Setting an alias
Removing an alias
Summary
Command-Line and Filesystem Navigation
Understanding the CentOS 7 filesystem hierarchy
Using man pages and the help command
Different types of documentation available in Linux
Using the man command
Using the GNU info command
Using the help command and the --help option
Other sources of documentation
Managing filenames with path expansion
File globbing
Wildcard expansion
Tilde expansion
Brace expansion
Command substitution
Quoting and escaping
File naming conventions
Managing files using command-line tools
Navigation commands
File management commands
Managing archives and compressed files
Compression
gzip and gunzip compression
bzip2 and bunzip2 compression
xz compression
zip
Archiving
Archiving with tar
Archiving and compression (.gzip) using tar
Archiving, compression (.bzip2), and listing contents using tar
Archiving and compression (.xz) using tar
Summary
Managing Text Files
Different methods to create a text file
Create a text file using the cat command
Create an empty text file using the touch command
Create a text file using the redirection symbol (>)
Create a text file using the echo or printf command
Create a text file using the vi editor
Editing files with the vi editor
Working with files in vi editor
Insert Mode
Line Mode
Determining line numbers in Line Mode of vi editor
How to execute external commands in Line Mode
Command Mode
Using text file manipulation tools
Different types of editor used to view file content
less command
more command
cat command
tac command
head command
tail command
wc command
file command
Viewing compressed files
cut command
sort command
uniq command
paste command
Redirecting output to files and programs
Pipes
tee command
Using grep for text matching
Text extraction using sed and awk
sed
awk
Finding a file (locate and find commands)
Locate
Find
Summary
User and Group Management
Understanding users and groups in CentOS 7
Defining a user
Identifying the current user
Understanding groups in Linux
Executing commands as superuser in CentOS 7
Switching users with the su command
Disadvantages of using the su command to grant root access to a normal user
Using sudo to run commands as the root user
Creating, modifying, or deleting local user accounts
Creating a user with the useradd command
Modifying a user with the usermod command
Deleting a user account with the userdel command
Creating, modifying, or deleting local group accounts
Creating supplementary groups with groupadd
Modifying existing groups with the groupmod command
Deleting a group with the groupdel command
Managing user passwords and aging policies
Setting a user password using the passwd command
Understanding the shadow password file
Understanding password aging parameters
Restricting user access
Fake shell or nologin shell
Summary
Managing File Permissions
Understanding Linux filesystem permissions
Effect of permissions on files and directories
Viewing applied permissions and ownership
Managing file permissions
Modifying file permissions with chmod using symbols
Managing file permissions with chmod using numbers
Managing file ownership
Understanding default ownership
Modifying user ownership with chown
Modifying group ownership with chown
Modifying both user and group ownership with chown
Modifying group ownership with chgrp
Special permissions
Modifying special permissions for files
Modifying special permission, for directories
Using sticky bit
Using setgid
Managing default permissions
Understanding umask
Managing ACL on files
Viewing ACL permissions
Using getfacl
ACL mask
Modifying ACL permissions
Using setfacl
Removing an ACL
Summary
Process Management
Understanding processes
Defining a process
Process creation on a Linux system
Processes types
Interactive processes
Batch processes
Daemons
Threads
Kernel threads
Process states
Viewing current processes
Listing running processes
The ps command
Displaying processes running from the current shell
Displaying all processes by their user
Displaying all processes in different formats
Sorting processes based on different parameters
Displaying processes by user
Displaying process information by name
Displaying process details by PID
Displaying a process hierarchy in a tree style
Displaying the child processes of a parent
Displaying the thread of a process
Displaying the pid of a process if the process name is known
Using the pstree command
Finding the PID of a running process
Using the pgrep command
pidof
The ps command with grep
Communicating with processes using signals
Defining a signal and its types
Sending signals to processes
Sending signals to processes by PID using the kill command
Sending signals to multiple processes by name
killall
pkill
Monitoring processes and load averages
Understanding load averages on Linux
uptime
w
Real-time interactive process monitoring
top
Managing a processes' priority with nice and renice
Understanding priority
Modifying priority
Viewing the priority of a process
Modifying the priority of a new process (nice value)
Modifying the priority of a running process (renice)
Controlling jobs on the command line
Understanding different terms related to job management
Jobs management with its associated controlling Terminal
Foreground processes or jobs
Background processes or jobs
Suspending a foreground process to the background
Managing jobs in the background
Summary
Managing Networking in CentOS
Linux networking concepts
Common terms used in Linux networking
IP address
IPv4
IPv6
Different classes of IP addressing
Public classes
Private classes
Loopback address
Link-local address or APIPA
Netmask
Gateway
Hostname
Nameserver
NetworkManager
Network interface naming conventions
Using Linux networking commands
Viewing IP address details
Using the IP command
Using ifconfig command
Netstat
Viewing the routing information
Using the ip route command
Using route command
Using netstat command
Gateway
Viewing nameserver details
Network troubleshooting utilities
Using ethtool command
Using ping command
Using tracepath command
Using traceroute command
Using mtr command
Verifying DNS connectivity
Using nslookup command
Using host command
Using dig command
Finding local ports and services information
Using the ss command
Using the netstat command
Web utilities
Graphical and non-graphical web browsers
Command-line file downloader (wget)
Command-line download and upload using curl
Managing a network with nmcli
Defining basic terms
Device or interface
Connection
Displaying network information using nmcli
Creating network connections using nmcli
Modifying network interfaces using nmcli
Editing network configuration files
Configuring networking options in static and dynamic modes
Configuring hostnames and name resolutions
Displaying and modifying the hostname
Modifying nameservers (DNS sever)
Accessing remote logins with SSH
Understanding OpenSSH
Executing commands over SSH remotely
Key-based SSH authentication
Configuring ssh-keygen for password-less authentication
Creating a SSH key pair
Configuring and securing SSH logins
Transferring files in Linux
Secure file transfer using SCP
Local to remote filesystem file transfer
Remote to local filesystem file transfer
Synchronizing files using rsync
Synchronizing data locally from one folder to another for backup
Synchronizing data from a local to remote host filesystem
Synchronizing data from remote host to local filesystem
Summary
Software Package Management
Managing applications using RPM
Anatomy of a RPM
What happens when you update an application
Using RPM to query options with RPM packages
Verifying RPM package signatures
Using RPM to install packages
Using rpm to remove packages
Using RPM to upgrade packages
Using RPM to verify packages
Importing a RPM GPG key
Managing applications using YUM
Understanding the YUM package manager
Using the YUM command line
Finding an application using yum
Installing applications using YUM
Displaying packages and their information with YUM
Removing applications using yum
Updating applications and the system using yum
Managing groups of applications using YUM
Using YUM history
Managing application repositories using YUM
Handling other miscellaneous options of yum
Managing official and third-party repositories
Official repositories of CentOS 7
Third-party repositories
Creating custom repositories
Summary
Overview of Essential Advance Utilities
Understanding system logging
Working with rsyslog
Configuring rsyslogd sections
Rsyslogd facilities and priorities
Rsyslogd rules
Log file rotation
Analyzing syslog entries
Monitoring live log file traffic using the tail command
Using the logger command
Working with systemd-journald
Finding events with the journalctl command
Configuring systemd-journald to store logs persistently
Understanding how to control the system and services
Defining essential terms
What is a daemon?
What is a socket?
What is systemd?
What are units?
What is systemctl?
Working with systemd and systemctl
Viewing states of service with systemctl
Viewing unit files with systemctl
Unit dependencies and unit file structure
Managing daemons using systemctl
Masking services
Controlling the boot process using systemd
What are systemd targets?
Switching your targets at runtime
Changing the default target of the system
Understanding SELinux concepts
SELinux contexts
Viewing SELinux context
Working with SELinux
Changing SELinux modes
Using setenforce for runtime changes
Setting default modes of SELinux
Modifying file context
Using restorecon for restoring the default context
Using chon for context management
Using semanage for context management
Modifying port context
Managing SELinux Booleans
Managing SELinux troubleshooting
Using sealert for troubleshooting
Understanding firewall concepts in CentOS 7
Firewalld concepts
Firewalld zones
Firewalld services
Managing firewalld
Using the firewalld-cmd command-line tool
Using the firewalld-config graphical tool
Working with firewalld
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
This book will provide an introduction to essential Linux skills using CentOS 7. It describes how a Linux system is organized and provides an introduction to key command-line concepts that an individual can practice on their own. It guides an individual in performing basic system administration tasks and day-to-day operations in a Linux environment.
Today, Linux is everywhere. It is an essential ingredient of most technical innovations, powering anything from the tiniest smart devices to the world's most gigantic supercomputer. Linux kernel development has been the world's largest collaborative project hitherto. Readers will learn the basics of Linux and open source technology in modern computing environment. This book will introduce users to CentOS 7 in a concise and practical way. Most of the command lines used in the book are explained with graphics for better understanding.
By the end of this book, you will have a solid understanding of working with Linux using command lines. You will learn core system administration skills for managing a system running CentOS 7, or a similar operating system, such as RHEL 7, Scientific Linux, and Oracle Linux. After reading this book, you will be able to perform installation, establish network connectivity and user and process management, modify file permissions, manage text files using command lines, and implement basic security administration.
This book is intended for any individual who wants to learn how to use Linux as a server or desktop machine in their environment. Whether you are a developer, fledgling system administrator, or tech lover with no previous Linux administration background, you will be able to start your journey in Linux using CentOS 7 with the help of this book.
Even though this book is written for novice Linux users, a seasoned Linux user will also have something to take away from each chapter. You don't need any prior experience of working with the Linux command line for this book. Most new users of Linux find it difficult to work with the command line and, occasionally, the choice as to which Linux distribution to start with may be confusing. You will learn Linux using CentOS 7, which is one of the most popular and stable Linux distributions based on RHEL 7.
Some of the key features of this book are as follows:
No previous Linux environment experience is required prior to reading this book
Readers will become comfortable with a popular and stable Red Hat Enterprise Linux distribution
Concise content, with a thorough coverage of important utilities
The book is written in such a manner that any computer user with basic familiarity with operating systems can start using it. The only prerequisite is to have some decent hardware on which you can install CentOS 7 and practice the commands covered.
Chapter 1, Getting Started with CentOS 7,establishes the environment for practicing the Linux commands to be covered in forthcoming chapters. You will begin with the installation of CentOS 7, followed by an introduction to the Bash shell environment.
Chapter 2, Command Line and File system Navigation,introduces users to the file system hierarchy, and basic command-line skills, such as navigational commands and backup utilities.
Chapter 3, Managing Text Files,focuses on working with common text manipulating utilities. Readers will learn how to work with the vi editor and input/output redirection in files or in programs.
Chapter 4, User and Group Management,focuses on user management. Readers will learn how to create, modify, or delete users and groups. They will also learn how to manage passwords and their aging policies.
Chapter 5, Managing File Permissions,focuses on managing ownership, permissions, and ACL. Readers will learn how to apply discretionary access controls via permissions and ownership, while also learning how to apply special permissions and ACL to files and directories.
Chapter 6, Process Management,focuses on process management and command-line monitoring. Readers will learn how to interact with processes and modify their priorities to keep systems running smoothly.
Chapter 7, Managing Networking in CentOS,focuses on network management in CentOS 7. Readers will learn how to validate and manage network configurations, including host name, DNS servers, and IP addressing. Readers will also learn remote logins using SSH, and file transfer using SCP and Rsync.
Chapter 8, Software Package Management,focuses on managing software using RPM and Yum. Readers will learn how to keep their systems up to date and install or remove applications by enabling official or third-party repositories.
Chapter 9, Overview of Essential Advance Utilities,focuses on a number of advance utilities related to system logging, system services management, and the securing of systems using firewalld and SELinux.
As always, we have put our best efforts into making this book's content relevant to user requirements. All command lines covered in this book are based on CentOS 7. You can use any minor release of CentOS 7, from CentOS 7.1 through to CentOS 7.6. A CentOS 7 operating system is the only requirement for this book. For beginners, however, it is recommended installing and practicing CentOS 7 in any desktop virtualization application, such as VirtualBox, and VMWare Workstation.
For Windows and macOS users who would like to use a virtual environment, they can use VMWare or VirtualBox to set up CentOS 7 and execute the given command-line examples. For those who are new to Linux, the installation of CentOS 7 is covered in Chapter 1, Getting Started with CentOS 7.
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "For example, DIRECTORY.. in mkdir usage means we have to insert the directory name we want to use with the mkdir command."
Any command-line input or output is written as follows:
$ mkdir -p -v demo/linux/centos
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Thereafter, the Begin Installation button will be enabled."
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
Community Enterprise Operating System, commonly referred to as CentOS, is a fast, stable, and open source enterprise-grade Linux distribution used on laptops, desktops, and servers. It is derived from the source code of Red Hat Enterprise Linux (RHEL), which is developed and maintained by the CentOS community. All proprietary content related to Red Hat Inc. is removed from the CentOS packages, which are then recompiled with CentOS community assets, such as logos and so on. CentOS 7 is an exact replica of RHEL 7, but is available for free with community support and updates. The CentOS project is now officially sponsored by Red Hat Inc. and is most suitable for environments where commercial support for operating systems is not mandatory.
In this chapter, we will give you a walk-through on how to install CentOS 7 on your computers. After installation, we will introduce you to the command-line console of Linux in order to useBash (short for Bourne Again Shell). This chapter teaches you how to set up your environment to perform all the exercises in the following chapters of this book.
In this chapter, we will cover the following:
Preparing to install CentOS 7
Performing manual installation
Accessing the command line using the console
Introducing the Bash shell
Bash shell and command execution
The CentOS community released its latest operating system version with the name CentOS 7.6-1810, where 7.6 comes from RHEL 7.6 and 1810 shows its release date (October 2018). CentOS 7.6 can be installed on physical or virtual hardware. You can use any of the main desktop virtualization software utilities, such as Oracle VirtualBox (https://www.virtualbox.org/wiki/Downloads) or VMWare Workstation (https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html), as per your environment. My choice for desktop virtualization software is VirtualBox as it is free, open-source, and easy to use. You will also need a working internet connection to download the CentOS image from the community download page.
For a minimal installation of CentOS 7.6, the following hardware requirements must be met:
512 MB RAM
4 GB HDD space
A network card
However, to practice all the exercises described in this book, we recommend that the following hardware requirements are met:
64-bit architecture support
1 GB RAM
10 GB HDD space
DVD drive or USB memory stick
A network card
There are different ways to get the software required to perform all the exercises in this book. However, the easiest and most flexible way is to download the iso file from the CentOS website and burn it to a DVD, or create a bootable USB drive with CentOS. Then, boot your PC using the ISO DVD image if you are using a virtual machine. If you are installing onto a physical system, then use a bootable USB drive or burned CentOS DVD for installation.
Use the following link to download the CentOS 7.6 (64 bits) ISO image file:
http://centos.mirror.net.in/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso
Once you have the right hardware and software for the CentOS installation, you should decide on the basic setup parameters to be specified while performing the installation. The following table lists the details we will use during the installation of our CentOS 7.6 server described in this chapter:
Setup parameter
Sample values
IP address
192.168.0.100
Netmask
255.255.255.0
Hostname
Server.example.com
Root password
Linux@12345
User name
Student
User password
Student@12345
Nowadays, the fastest and easiest way to install CentOS is to use a bootable USB drive; however, in our case, I have chosen to use the DVD ISO image with a virtual machine. First, we need to boot the computer system/virtual machine using the DVD. On booting from the DVD, you will get a cool CentOS screen displaying the basic installation options, and testing the media and troubleshooting options.Once your system/virtual machine is up and running with a bootable DVD of CentOS 7, follow these steps to install CentOS on your system:
We have to choose the
Install CentOS 7
option and press
Enter
,
as shown in the following screenshot
.
This will start the graphical installer and ask about the language to be used during the installation process
:
Now,
you will see a
WELCOME TO CENTOS 7
s
creen, prompting you to choose your language and keyboard settings. Choose your respective language and keyboard settings
and
click on the
Continue
button
, as shown in the following screenshot
.
In my case, I have chosen
English
:
After this,
yo
u
will see
a
n
INSTALLATION SUMMARY
screen
.
From this screen, you can specify the settings you want to use for the three
different sections and their sub-sections, as shown in the following screenshot
:
On this screen, the Begin Installation button will remain disabled as long as any setting from a section or subsection displayed on the INSTALLATION SUMMARY screen is still incomplete. If all the sections and subsections displayed on this screen are complete with minimum installation instructions, only then will the Begin Installation button be enabled.
By default, the installer does automatic partitioning for our hard disk. If we want to use the default layout, then we must click on INSTALLATION DESTINATION, and then approve the disk device we want to use for automatic partitioning by clicking on the Done button on the next screen. Thereafter, the Begin Installation button will be enabled and we can install CentOS with a minimal configuration, as shown in the following screenshot:
If you are a beginne
r and want to use
CentOS 7 with a
graphical user interface
(
GUI
), then follow these installation instructions. In this step, we'll learn about the usage of CentOS and then modify certain options that need to be configured during installati
on. The
INSTALLATION SUMMARY
scr
een has three sections, as follows:
LOCALIZATION
SOFTWARE
SYSTEM
These three sections are explained as follows:
LOCALIZATION
: This section further contains the following three sub-sections for configuration:
DATE & TIME
KEYBOARD
LANGUAGE SUPPORT
Or these three, the DATE & TIME sub-section is often required to be configured. The other two we have already configured in the previous steps.
In theDATE & TIMEoption, select the time zone that you are in by clicking on your location on the world map. You can also configure your current specificDATE & TIME from this window, as shown in the following screenshot:
We leave theKEYBOARD and LANGUAGE SUPPORTsettings at their defaults, and move to the next section to be configured—in this case,SOFTWARE.
SOFTWARE
:
This section further contains two sub-sections for configuration:
INSTALLATION SOURCE
SOFTWARE SELECTION
Under theSOFTWARE section, we keepINSTALLATION SOURCE set to its default local media (DVD-ROM), as shown in the following screenshot:
The next sub-section for configuration is SOFTWARE SELECTION. This forms an important part of the installation procedure. Click on this option and you will get the screen shown in the following screenshot. From here, you can choose the default base environment and add-ons that are available for the selected environment. For our practice demonstration, we will install the GNOME Desktop base environment with four add-ons: GNOME Applications, Office Suite and Productivity, Development Tools and System Administration Toolsas shown in the following screenshot:
SYSTEM
: This section further contains four sub-sections for configuration:
INSTALLATION DESTINATION
KDUMP
NETWORK & HOST NAME
SECURITY POLICY
In this section, we keep the KDUMP and SECURITY POLICY sub-sections set to their default parameters, and configure the two remaining sub-sections as follows:
Inthe INSTALLATION DESTINATIONsub-section, we specify where we want to install CentOS. Automatic partitioning is selected by default, but wecan create a manual partitioning scheme of our own as per our requirements. As a bare minimum standard, we will create the following three partitions:
Boot partition
:
This partition s
tores bootable files
such as the kernel image, and so on.
Swap partition
:
This is f
or swapping files and programs in and out of the RAM. It is generally twice the size of the RAM.
Root (
/
)
partition
:
This co
ntains the
Linux filesystem.
The following screenshot shows where to click to create manual partitions:
Choose the device onto which to install the OS, and select
I will configure partitioning
. Finally, click on the
Done
button to proceed with the creation of multiple partitions as shown in the following screenshot:
Now, we create a minimum of three partitions in the partition table (
boot
,
swap
, and
/
). In my case, I have kept
File System
as
xfs
, with the
Standard
Partition
type for the
boot
and
/
partitions. For the
swap
partition, the
File System
type is kept as
swap
, as shown in the following screenshot:
Next, on pressing
Done
, you will get the
SUMMARY OF CHANGES
dialog box. Click on the
Accept Changes
button to begin creating on the disk the partitions that we specified in the partition table, as shown in the following
screenshot
:
NETWORK & HOST NAME
: In this final
part of
the installation summary, which we'll configure networking. You can leave the default settings as they are to get the IP address from the DHCP server, or click on
NETWORK & HOST NAME
to set up networking manually. From the dialog box, click on the
IPv4 Settings Tab
, then choose the method as
Manual
from drop-down menu and specify the private IP address, as shown in the following screenshot:
Further in the NETWORK & HOST NAME settings, change the network connection state from Off to On, as shown in the following screenshot:
Now that all the
INSTALLATION SUMMARY
sections are configured as required, the
Begin Installation
button is enabled. Click on the
Begin Installation
button to start the process of installation, as shown in the following
screenshot
:
Next, the screen prompts for user settings. Here, we click
Root Password
first and set the password to
Linux@12345
.
Next, we click on
CREATE USER
to create a user. For both the
Full name
and
User name
fields, enter
student
, and set
Password
as
Student@12345
. Here also we have to click on the
Done
button twice to confirm the password, as shown in the following
screenshot
:
Have a cup of coffee while the installation process is in progress. Once the installation is complete, remove any installation media (the instructions only apply to the DVD method) and click on the
Reboot
button, as shown in the following
screenshot
:
Once the system has rebooted, we will get the INITIAL SETUP screen, where we have to accept an EULA agreement before logging in to the system. Here, we click on
LICENSE INFORMATION
to accept the license agreement, as shown in the following
screenshot
:
Once the license agreement has been accepted, the
FINISH CONFIGURATION
button will become enabled. Click on it to reach the login screen.
On the login screen, click on the
student
username
and enter the password as
Student@12345
, as shown in the following
screenshot
:
After a successful login, you will see the welcome screen that is displayed only when the user LOGS IN for the first time. Click on the
Next
button to reach the desktop.
Congratulations! You have successfully installed the latest version of CentOS 7 on your computer system or virtual machine.
You can explore your new CentOS 7 environment and perform other tasks, such as updating the system or installing other useful software for daily operational requirements. To power down the system, click on the right corner of desktop. You will get a drop-down menu; from there you can click
on
Shut down
, as shown in the following screenshot:
