• Aucun résultat trouvé

Daemon Control

Dans le document Linux Security (Page 132-145)

In Greek mythology, daemon means supernatural being. In Linux, daemons are invisible programs that run in the background. A daemon is not attached to any terminal, because no output on the screen is expected from it. The common func-tions of daemons are to do the following:

◆ Serve other client programs

◆ Publish information as required by other programs

◆ Assist other programs in accessing a resource on the computer

◆ Enable two individual programs to communicate with each other

A user might never need to know about a daemon. But, for an administrator, knowledge of daemons is critical.

Daemons can be invoked by using any of the following methods:

rcscript at boot time

initmethod at boot time

inetddaemon

tcpd

Daemons are usually associated with a network port. A network port is an isolated channel through which a particular daemon sends or receives information. For example, an http daemon will have the port 80 attached to it. Therefore, if an http server is attached to port 80, and a domain, for example,www.abc.com is hosted on it, typing http://www.abc.comor http://www.abc.com:80would display the same output in the Web browser.

Some default ports have been assigned to various daemons, as given here:

◆ HTTP to port 80

◆ Post office protocol (POP) to port 110

◆ Simple Mail Transfer Protocol (SMTP) to port 25

◆ File Transfer Protocol (FTP) to port 21

◆ Telnet to port 23

The /etc/servicefile should contain information about the ports and daemons on your system.

The purpose of a daemon is to serve the system while working in the background.

A mechanism exists that allows daemons to start and shut down without human intervention. This is accomplished by the inetddaemon, which is a special dae-mon that dae-monitors the ports of a computer. The inetddaemon invokes the appro-priate daemon, according to the schedule. The /etc/inetdfile has information about all the daemons that are under the control of inetd.

You can set new daemons to work under inetd by adding the appropriate fields in /etc/inetd. The file has seven fields to configure various aspects of the daemon:

Service. This is the name of the daemon. This name should also be listed in the list of services, defined in /etc/servicesfile.

Socket_type. This can be one of the following values:

dgram,raw,rdm, and seqpacket.

Protocol. This specifies the protocol the daemon will use. All available protocols are listed in /etc/protocols.

Wait/nowait. This field is either waitor nowait. This field is used for the datagram sockets only. If a datagram server frees the datagram socket after connecting to a peer, the nowaitvalue is used. The nowaitvalue indicates that the socket is free to receive messages. The waitvalue is used for the datagram servers that process all incoming datagrams on the socket.

User. This field specifies the username under which this daemon will run. Each daemon is associated with a user name. The access permis-sions for the user also apply to the daemon.

Program. This is the name of the executable file of the daemon.

Argument. This contains the command line arguments that are passed to the server when the command is executed.

There are many daemons available in standard Linux distributions. Descriptions of some of the important daemons are given here:

fingerd. This daemon maintains information that can be retrieved using the fingercommand.

gated. This daemon provides services for routing protocols.

gdc. This daemon controls the gated daemon.

syslogd. This daemon maintains a log for the system.

klogd. This daemon listens to messages from the kernel and prioritizes and processes OS messages.

lpd. This daemon services line printer requests.

mountd. This daemon controls NFS-mounted drives.

named. This is an Internet Domain Name Service (DNS) daemon. This daemon is used to provide name resolution services.

identd. This daemon services all programs that require TCP/IP identifi-cation protocol.

imapd. This daemon controls remote mail access.

inetd. This daemon invokes other daemons as listed and configured in the /etc/inetd.conf.

pppd. This daemon controls Point-to-Point protocol communications.

rexecd. This daemon handles remote execution of commands.

rlogin. This daemon provides services that allow users to login to the system from a remote location.

rcmd. This daemon provides assistance in execution of commands given from remote locations.

rshd. This daemon also provides assistance in execution of commands given from remote locations.

talk. This daemon enables communication between users.

telnetd. This daemon serves telnet clients.

tftpd. This daemon services tftprequests.

ftpd. This daemon services requests from the ftpclients.

Linuxconf

Linuxconf is a sophisticated administration system for the Linux operating sys-tem. With this system, you can perform almost all administrative tasks. You can configure the following items by using Linuxconf:

1. Networking (client)

◆Basic TCP/IP setup

◆Routing

◆DNS location

◆NIS client

◆IPX (Novell setup)

◆PPP and SLIP dialout 2. Networking (server)

◆Boot services: RARP and DHCP

◆DNS

◆IP Aliasing

◆NFS

◆Mail

◆Uucp 3. User account

4. File systems (partitions) 5. Boot mode

◆LILO

◆Boot runlevel

Linuxconf also can be run from the command line. You need to execute the

Linuxconf command at the command prompt. Linuxconf has several aliases, which allows you to enter directly into one of its functional areas. These include the following:

domainname. Prints and sets the NIS domain name.

dnsconf. Displays the main menu of the DNS configure program.

fixperm. Ensures that the critical files and directories have proper own-ership and permissions.

fsconf. Displays the file system’s configuration menu.

hostname. Prints and sets the hostname.

Linuxconf. Activates Linuxconf ’s main menu.

passwd. Allows you to change your password or the password of other users, if you are the root user.

netconf. Directs you to the networking submenu of Linuxconf.

userconf. Takes you directly to the user configuration menu.

The WWW Interface. Allows you to operate Linuxconf from a Web browser. To do this, type the following address in the address bar:

http://<computer_name>:98/

The menu structure is the same across all three interfaces: command line, GUI, and the Web browser interface. The advantage of the Web interface is that you can set bookmarks to permit rapid movement to specific configuration screens.

When you execute Linuxconfat the command prompt, the Linuxconf interface, shown in Figure 4-1, is displayed.

As shown in Figure 4-1, the main menu displays the following items:

◆ Config

◆ Control

◆ Status

The following section discusses these menu items one by one.

FIGURE 4-1 The Linuxconf interface.

Config

The options in the Config menu are listed here:

◆ Networking

◆ User accounts

◆ File systems

◆ Miscellaneous services

◆ Boot mode

These submenus are displayed in Figure 4-2.

The Networking submenu provides you with options for configuring your network. The options of the Networking submenus are shown here:

Client tasks. The Client tasks submenu enables you to specify basic host information and details of the DNS server that will be used to resolve IP addresses.

FIGURE 4-2 The Config menu.

Routing and gateways. The Routing and gateways submenu allows you to configure the routing options for your Linux computer. The screen to specify the default gateway and enable IP routing is displayed in Figure 4-3.

Host name search path. The Host name search path submenu allows you to specify the order in which the name services, such as NIS and DNS, will be probed (see Figure 4-4).

FIGURE 4-3 The default gateway and routing screen.

FIGURE 4-4 The Name service access screen.

Network Information service. The Network Information service sub-menu enables you to specify the NIS domain and NIS server. The screen to configure the network information service is displayed in Figure 4-5.

Remote mail servers (fetchmail). This enables you to configure mail servers. The screen for configuring the mail server is displayed in Figure 4-6.

FIGURE 4-5 The NIS client configuration screen.

FIGURE 4-6 The Remote mail retrieval basics screen.

Server tasks. Server tasks enable you to configure export file systems and IP aliases for virtual hosts. The screen for specifying IP aliases is dis-played in Figure 4-7.

Misc. This selection allows you to specify information about other hosts and networks. It also allows you to specify which networks or hosts are allowed to access Linuxconf to configure your computer.

The options within the User Accounts menu (refer to Figure 4-2) are displayed in Figure 4-8.

FIGURE 4-7 The Edit IP aliases configurations screen.

FIGURE 4-8 The Options within User Accounts submenu.

The User Accounts submenu provides you with options to configure and manage user accounts. The options in the user accounts submenu are as follows:

Normal. This option allows you to add, modify, or delete users and groups. It also allows you to change the root password. The screen for managing groups is displayed in Figure 4-9.

Special Accounts. This option allows you to manage Point-to-Point Protocol (PPP), Serial Line Internet Protocol (SLIP), Unix-to-Unix Copy Protocol (UUCP), and Post Office Protocol (POP) accounts.

Policies. This option enables you to configure password and account policies for users. After the password policy is set, a user will not be able to set a password that does not fulfill the requirements of the password policy. This option also allows you to manage user, PPP, and SLIP shells. The Password/Account setting policies screen is displayed in Fig-ure 4-10.

FIGURE 4-9 The User groups screen.

The Files systems submenu enables you to manage various drives and devices mounted on your computer. It also allows you to check file permissions. The options in the File systems submenu are displayed in Figure 4-11.

FIGURE 4-10 The Password/Account setting policies screen.

FIGURE 4-11 The options in the File systems submenu.

Boot mode enables you to configure the boot options for your computer. The options in the boot mode are displayed in Figure 4-12.

Control

The options in the Control menu are used to configure various settings in your computer. These options are displayed in Figure 4-13.

FIGURE 4-12 The options in boot mode.

FIGURE 4-13 The options in the Control menu.

Status

The Status option displays various messages and logs generated when you are using your computer. The options in the Status menu are displayed in Figure 4-14.

The screen in Figure 4-15 displays the kernel boot messages.

FIGURE 4-14 The options in the Status menu.

FIGURE 4-15 The Kernel boot message screen.

Dans le document Linux Security (Page 132-145)