0% found this document useful (0 votes)
10 views11 pages

CIT 06204 Linux - 5 - Managing Linux Services

Uploaded by

musomicatherine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views11 pages

CIT 06204 Linux - 5 - Managing Linux Services

Uploaded by

musomicatherine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

DIPLOMA IN CIT

CIT06204 Linux_UNIX

5. Managing Linux
Services
[email protected]
1
Chapter Contents
5.1 Controlling Access to Services
5.2 Run Levels
5.3 TCP Wrappers
5.4 Xinetd
5.5 ntsysv
5.6 chkconfig
5.7 Service
5.8 Gathering System Information
2
5.1 Controlling Access to
Services
• Managing access to service helps to manage security in the
system
• The easiest way to deny access to service is to turn it off.
• The services managed by xinetd and /etc/rc.d hierarchy can be
configured to start or stop using three applications:
i. Ntsysv – a text based application used to configure services that
are started at boot time for each run level. Changes do not take
place immediately. Services can not be started, stopped or
restarted using this program.
ii. Chkconfig - a command-line utility used to turn services on and off
for each run level. Changes do not take place immediately.
Services can not be started, stopped or restarted using this utility.
iii. Service - a command-line utility that displays a desciption of each
service and whether each service is started. It allows to start, stop
and restart each service.

3
5.2 Run Levels
• Run level is a state or mode that is defined by services listed in the
directory /etc/rc.d/rcx.d, where x is the run level number.
• The following is a summary of run levels:
0 Halt
1 Single-user mode
2 Not used
3 Full Multi-user mode
4 Not used
5 Full Multi-user mode (with X window GUI)
6 Reboot
• The default run level can be changed by modifying the file
/etc/inittab, the line to edit in this file looks as follow

Id:3:initdefault:

4
5.3 TCP Wrappers
• Any network services managed by xinetd can
use TCP wrappers to manage access.
• Xinetd can use the /etc/hosts.allow and
/etc/hosts.deny to configure access to system
services.
• The above two files contain the rules used to
allow/deny access to services.
• Permissions to grant or deny access can be
based on individual IP address or hostmanes.

5
5.4 Xinetd
• Can be used to control access to internet service.
• Can provide/deny access to particular hosts, or
allow/deny access at certain times.
• Can also limit the rate of incoming connections.
• Runs constantly and listens to all the ports for services it
manages.
• The service can be enabled/disabled by editing
configuration file which is /etc/xinetd.conf.
• If the disable attribute is set to yes, the service is
disabled.
• If the disable attribute is set to no, the service is enabled.

6
5.5 ntsysv
• The ntsysv utility provides a simple interface for
activating or deactivating services.
• It can be used to turn an xinetd managed service
on or off.
• It can also be used to start or stop a service in
the /etc/rc.d hierarchy.
• It works in the text mode.
• Use up and down arrows to navigate the list.
• The spacebar selects/unselects the services.
7
5.6 chkconfig
• Can be used to activate and deactivate
services.
• Chkconfig –list command displays a list of
services and whether they are started or
stopped.

8
5.7 Service
$ service sshd
Shows what options are available with sshd

$ service sshd restart


Will restart sshd service

$ service sshd stop


Will stop sshd service

$ service –status-all
Shows the status of all services
9
5.8 Gathering System
Information
• Allows to collect important system
information like the following:
• Amount of free memory
• Hard disk partitioning
• Processes that are running

10
Gathering System
Information
• ps ax – lists all current system processes
• ps aux – lists all processes with the owner

• free: shows total, used, shared memory


• free –m: shows above memory in MB

• df: shows disk usage


• Df -h: shows disk usage in MB and GB
11

You might also like