4276_linux_ops.txt
Edited: Thursday 1 May 2025

|1.1 Superuser Conventions
Fedora, in common with Linux in
general, has two types of user
account, one being a standard user
account with restricted access to
many “of the administrative fles
and features _of the “operating
system, and the other a superuser
(root) account with elevated
privileges.Typically,a user can
gain root access either by logging
in as the root user, or using the su

  • command and entering the root
    password. In the following exam-
    ple, a user is gaining root access

9 1 1119
1.1 Superuser Conventions

via the su - command:

Z′′′】e//C_′〕C/e厂〕')O_…e/′\/e/′ ′_′丿`重…〉 SU 一

Password:

什00亡@de门q0_Se门/e厂 一)/另绪

Note that the command prompt for

a regular user ends with a $ sign

while the root user has a # charac-

ter.、When working with the com-

mand-line, this is a useful indica-

tion as to whether or not you are

currently issuing commands as the

root user.

Iiff the su - command fails, the root

account on the system has most

likely been disabled for security

reasons. In this case,the sudo

command can be used instead as
10 1 1119
1.1 Superuser Conventions

outlined below.

Alternatively,a single command

requiring root privileges may be

executed by a non-root user via

the sudo command.、Consider the

following attempt to update the

operating system “with the latest

patches and packages:

[neil@qemo-sever ~/ 石 qnf uUpqate

Not root, 5ubscription Management repositories

not Upqated

Error: his commandq has to be run under the root

USE-

Optionally,user accounts may be

confngured so that they have

access to root level privileges.

Instead of using the su - command
111 1119
1.1 Superuser Conventions
to fhrst gain root access, user
accounts with administration
|〔〕「iVi|e…〕仨〉S are able to run otherwise
restricted commands using SUd0O.
[neil@qemo-sever 广 suqo qnf uUpqate
We trust you have received the usual lecture from
the local 5ystem
Adqministrator. 儿 usually boils qown to these three
things:

1) Respect the privacy of others.

2) Think before you type.

3) With 8reat power comes 8reat
responsibility.
Lsuqoj password for nei:

12 1 1119
1.1 Superuser Conventions
Upqating 5ubscription Management repositories.
To“perform “_multiple _commands
without repeatedly using the sudo
command,a command prompt with
persistent super-user privileges
may be accessed as follows:
/厂7e//廷′/〕C]/e「)叮O_Se/气/e厂丿互畜 SU9QO sU 一
/厂】e//《夕’/〕C]/e「7qO_Se/『/e厂丿夹孝
The reason for raising this issue so
early in the book is that many of
the _command-Iline exam pl1es
outlined in this book will redquire
root privileges. Rather than repeti-
tively preface every command-line
example with directions to run the
13 1 1119
1.1 Superuser Conventions
command as root,the command
prompt at the start of the line wil
be used to indicate whether or not
the command needs to be per-
formed as root. If the command
can be run as a regular user,the
command will be prefxed with a 不
command prompt as follows:
多 qate
Ilf, on the other hand, the command
requires root privileges, the com-
mand will be“preceded by a 当
command prompt:
江 qnf install 0openssh

14 1 1119
|2.1 What exactly is Linux2
Linux is an - operating system in
much the same way that Windows
is an operating system (and there
any similarities between Linux and
Windows end). The term operating
system is used to describe the
software that acts as a layer
between the hardware in a comput-
er and the applications that we all
run on a daily basis. When program-
mers write applications,they
interface with the“_operating
system to perform such tasks as
writing fhles to the hard disk drive

211 1119
2.1 What exactly is Linux?
and displaying information on the
screen.Without an “operating
system,every programmer would
have to write code _to directly
access the hardware of the sys-
tem. In addition,the programmer
would have to be able to support
every single piece _of hardware
ever created to be sure the applica-
tion would work on every possible
hardware conhguration. Because
the operating system handles all of
this hardware complexity,applica-
tion development becomes a much
easier task. Linux is just one of a
number “of different operating
systems available today.

22 1 1119
7.1 An Overview of COCK-
pit
Cockpit is a light-weight,web-
based interface that allows general
system administrative tasks to be
performed remotely. When “ in-
stalled and conflgured, the system
administrator simply opens a local
browser window and navigates to
the _Cockpit port on the remote
server.、After loading the _Cockpit
interface“into the “browser and
logging in, a wide range of tasks
can be“performed visually using
administration and _monitoring
186 / 1119
7.1An Overview of Cockpit

tools:.

Behind the scenes,Cockpit uses
the same tools to perform tasks as
would normally be“used when
working at the command-line, and
updates automatically to reflect
changes ˇoccurring elsewhere on
the system. This allows Cockpit to
be used in conjunction with other
administration tools and tech-
nigues without theˇrisKk of “one
approach -overriding another.
Cockpit can also be confngured to
access “more than _one server,
allowing _multiple servers to be
administered and _monitored
simultaneously through a single
browser session.

qo 5zcu 标 命
7.1 An Overview of Cockpit
Cockpit is installed by default with
a wide range“of tools already
bundled. Cockpit also, however,
allows additional extension plugins
to be installed as needed.Cockpit
is also designed so that you can
create your own extensions using a
combination of HTML and Java-
Script to add missing or custom
functionality.
Cockpit「s “modular design also
allows many features to be embed-
ded into other web-based
applications.

园 命
7.12 Podman Containers

日 E 园 0 en

遣 - 一 一 一 一 一 一 一 一

Aecount ′ Images 日 ceoneimee

园 国 园 一 ˇ 志 吴 一 百

Figure /-~10

The“_Podman extension is not

installed by“default but can be

added via the Cockpit Applications

screen or by running the following

command:

沥 qnf install cockpit~-podman

Linux containers are covered later

in _the“_book starting with “An

Introduction to Linux Containers“.
213 / 1119
7.18 Connecting to Multi-
ple Servers
Cockpit can “_beˇ_conngured to
administer “multiple servers from
within _ a single session. This
requires that the _Cockpit dash-
board be installed on the primary
system (in other words the system
to which the initial Cockpit session
will be established). To install the
Cockpit dashboard package,run
the following command:
沥 qnf install cockpit-dqashboard
Once the dashboard has been
224 1 1119
7.18 Connecting to Multiple Servers
installed,sign out of Cockpit and
then sign in again. The dashboard
will _now “appear“in the Cockpit
interface as highlighted in Figure
7-16:
宣 _雹t l 围 f鲁【’】。r高_de
’|。-
I>.s'1豇\丽 ′工〈二三\′亡戛二 亘二丨厂VO【e|〈 GmbHVirtualBox

syst.r’】 Machine D 33882df723a14616aa588e818e51448

Logs 0

Storage Operating System Fedora 31 (\乏丶/(}厂【〈Stat\【〕门 Edition)

Networking 焦 Bug Fi Updates Available

Figure /-16
When selected,the dashboard
page will display performance
graphs for the current system and
provide a list of currently connect-
ed systems:
225 / 1119
7.18 Connecting to Multiple Servers
FEDORAWORKSTATIONEDITION & Piiieaed | . s
“ 真
“: Z亡′‘工「一/k星’偏变/逊〉、/亡亘\喜代/\丿》寸靴蚓卫/ -言 ′萧 颂 吴 吴 吴 国 沥 吴 吴 吴 颂 颂 育 园 刑 园 吴 _{三@ 瞒 6 T T e Figure 7-17 To add another system,click on the + button highlighted in Figure 7-17 above, enter the IP address or host name of the other system and select a color by which to distin- guish this server from any others added to Cockpit before clicking on the Add button: 226 1 1119 7.18 〔二O「1「1r三Cti「1重〕] to Mu|tiF)|e Servers Add Machine to Dashboard 丶 国 园 园 许 园 园 园 园 园 沥 园 刑 沥 吴 刑 园 园 沥 园 沥 刑 沥 刑 园 沥 刑 沥 沥 园 园 刑 园 园 刑 园 刑 刑 园 园 园 刑 园 刑 沥 沥 沥 沥 Address | 192.168.1.134 M . 目 ˇ 一 一 童- Cancel 髓′ Figure /-18 Enter the user name and password to be used when connecting to the other system, then click on the log in button. The newly added server will now be listed in the Cockpit dashboard and will _appear “ in graphs represented by the previous- Ily selected color: 227/ 1119 7.18 Connecting to Multiple Servers 宣. Memoy ˇNewetk 。DskVo 叭 一 一 丨 a y 8 一 国 河 '簪l"螂/ 一 「 _ F n邂矗JL'|'_'_'′4 一 十 一 一二_[一
a ˇ 口 国
昱雀’)厂雷’d晏厂【`口 Fedomalhoretatongdtion)
囝 looshostiocidomain Fodonal(GorerFdtom
Figure 7-19
To switch between systems when
using Cockpit, simply use the drop
down menu shown in Figure 7-20
below:
228 1 1119

Backlinks

See Also