Process A
Process B
Page
Frame
Page
Frame
0
1
0
N/A
1
N/A
1
2
2
N/A
2
N/A
3
3
3
N/A
4
0
4
N/A
5
N/A
6
N/A
338
◾
Linux with Operating System Concepts
With this brief introduction to virtual memory, we will reference virtual memory and
swap space later in the book. We will also examine tools to gage the impact of virtual
memory on the processor’s performance.
8.7 SETTING UP NETWORK CONNECTIVITY AND A PRINTER
8.7.1 Establishing Network Connections
During your Linux installation, you should be able to establish your network connectivity.
You can also perform this afterward. Once Linux is installed and you are logged in, you
will be at the desktop. In CentOS (assuming Gnome), select the System menu and from
there, the Preferences selection. From the list, select Network Connections. The Network
Connections window will appear (see the left side of Figure 8.16). Here, you will find a list
of all of your devices.
In our example, we have only a Wired Ethernet connection named System eth0. Selecting
it allows us to select Edit… or Delete… In response to Edit…, the edit window appears
(see the right side of Figure 8.16) allowing us to change the MAC address, add security,
change IPv4, and IPv6 settings. We also can alter the device’s startup behavior through two
checkboxes. With
Connect automatically
, the device is started at boot time while
Available to all users
means that any user is able to access the network through
the device. Click Apply… to close the Editing window (you will be asked to log in using the
root password first) and then you can close the Network Connections window.
If, once you have installed Linux, you do not have network access, make sure a device is
listed under Network Connections and that both of these checkboxes are selected. If you
still do not have network access, it may be due to other issues such as the network service
FIGURE 8.16
Network connectivity in CentOS.
Installing Linux
◾
339
not running, a firewall issue, or some physical problem with either your network card or
your router. These issues are addressed in Chapters 12 and 14.
In Ubuntu, select System Settings to bring up the System Settings window (much like
Windows’ Control Panel). From here, select the Network button. A Network configura-
tion window appears. Our choices are to select Wired and Network proxy (Wired is the
only device to appear because we do not have any other device installed in this VM). From
Wired, we can turn it on or off (it is currently on), view information about it, and click on
Options… to bring up the Options window. The Options window presents identical infor-
mation to the Editing window from CentOS. Compare this as shown in Figure 8.17 with
that of Figure 8.16.
8.7.2 Establishing Printers
The process to connect to add a printer to your Linux system is very similar to add-
ing a printer to a Windows computer. You will find the approach between CentOS and
Ubuntu to be nearly identical; so, we only focus on CentOS. Under the System menu,
select Administration and then Printing. This brings up a Printer configuration window
that should have no printers listed. Click on New and before proceeding, you are asked
to log in as root. After entering the root password, you are shown the New Printer win-
dow where you can select a printer from a parallel port, serial port, other, or a network
printer.
Assuming that you want to connect to a network printer, you will have choices of Find
Network Printer, AppSocket/HP JetDirect, Internet Printing Protocol (ipp), Internet
Printing Protocol (https), LDP/LPR Host or Printer, and Windows Printer via SAMBA,
see Figure 8.18. In selecting any of these, you will be asked to identify the host except for
SAMBA where you are asked to provide an smb address. You can also try to find a printer if
you select Find Network Printer. In our case, we are going to connect to an HP Laser Jet; so,
we will fill in AppSocket/HP JetDirect. Under Host, we enter the IP address of the printer
that then establishes the Forward button as available.
FIGURE 8.17
Network connectivity in Ubuntu.
340
◾
Linux with Operating System Concepts
Clicking Forward brings us to a page of installable options. We can, for instance, select
trays, envelope feeder, amount of memory available on the printer, and so forth. Clicking
Forward again brings us to a page where we describe the printer. We establish a “short
name,” a human readable name, and a location. Only the short name is required. We might
use
lpr1
(laser printer 1) although in our case, the short name is already provided as
HP-Laserjet-4250
. Clicking on Apply finishes our installation of the printer. We are
then asked to authenticate as root. With the printer installed, we are asked if we want to
print a test page.
Our Printer configuration window now appears with a printer available. This printer is
now the default printer. If we add another printer, we can change the default. This printer
will be used by most applications software as it is established as the default printer.
We can also communicate to the printer through the command line through a variety
of Linux printer commands. Table 8.3 lists some of the most common commands. For
instance, to simply print a document, you would issue
lp
filename
to print
filename
to
the default printer, or
lp –d
printername filename
to send
filename
to the printer
printername
. Both lp and lpr can be used to print multiple files with one command. Both
printing commands, lp and lpr, are similar in usage and capability; lpr was developed for
BSD Unix while lp was developed for Unix System V. You can also pipe the output of a
program to lp or lpr as in .
/program | lp
.
FIGURE 8.18
Configuring a printer.
Installing Linux
◾
341
8.8 SELINUX
SELinux is
security-enhanced
Linux. This addition to Linux allows one to implement secu-
rity options that go far beyond the simple rwx permissions available for data files, execut-
able files, and directories. SELinux provides mandatory access control through a series of
policies
. Each policy defines access rules for the various users, their roles, and types onto
the operating system objects. We will define these entities as they are used in SELinux
below, but first, let us look at SELinux more generally.
SELinux became a standard part of Linux with version 2.6 and is available in many
Linux distributions, including Red Hat and more specifically CentOS and Fedora, Debian
and Ubuntu, and a basic form is available in OpenSUSE. SELinux implements a number
of policies with names such as
targeted
(the default),
strict
,
mls
(multilevel security
protection), and
minimum
. SELinux should be enabled upon system initialization after
booting with the policy of targeted selection. You should find the SELinux configuration
file (
/etc/selinux/config
) with these two directives
SELINUX
=
enforcing
SELINUXTYPE
=
targeted
The first directive can also take on values of
permissive
and
disabled
. The second
can use any of the available policies. You can change the mode that SELinux is running
through the
setenforce
command followed by
Enforcing
,
Permissive
,
1,
or
0
TABLE 8.3
Linux Printer Commands
Do'stlaringiz bilan baham: |