Article Title: Start and disable services and corresponding port numbers in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
/Etc/services view the system preset service and port. the scripts started and closed for each DAEMONS (service) are placed in/etc/init. d/, while the red hat system is put in/etc/rc. d/init. d. The super daemon control parameter file is stored in/etc/xinetd. d.
Stand alone (independently started) and super daemon (super Service)
Stand alone
As the name implies, stand alone directly executes the Service's row scanning file, so that the execution file can be directly loaded into the memory for operation. This method can be used to start the service
It has the advantage of fast response. Generally, scrip is started under the/etc/init. d/directory, so you can use:
[/Etc/init. d/sshd restart] and other methods to start this service;
Super daemon
A super Service is used as the manager to manage some network services. In centos, xinetd is used as the super daemon.
The response speed is slow. However, you can use super daemon to provide additional control, such as controlling when to start, when to connect, and when to connect to the IP address,
Whether to allow concurrent connections. The configuration file is usually placed in/etc/xinetd. d/, but after the configuration is complete, you need to restart it with [/etc/init. d/xinetd restart.
If you want to disable PORT25 on the system, the simplest way is to first find the Startup Program of PORT25.
# Netstat-tnlp
TCP 0 0 127.0.0.1: 631 0.0.0.0: * listen 1171/cupsd // port 22 is enabled by the program cupsd.
If you cannot see the program CUPSD, use nmap localhost to view the local port. The port and corresponding program are displayed.
# Which cupsd
/Usr/sbin/cupsd // locate the location of the cupsd program.
If WHICH cannot be used, use LOCATE in combination with regular notation to find the command.
# Locate cupsd | grep '/cupsd $'
/Usr/sbin/sshd
Use RPM for processing:
# Rpm-qf/usr/sbin/cupsd
Cups-1.1.17-13 // locate the program name
# Rpm-qc cups | grep init
/Etc/rc. d/init. d/cups // locate the startup location of the program.
#/Etc/rc. d/init. d/cups stop // stop the program.
1. To start telnet, you must first install the telnet server. Therefore, run the rpm command to check whether telnet-server is installed. [/Rpm-qa | grep
Telnet-server] if it is not installed, download or find the CD and install [yum install telnet-server.
2. Because it is super daemon management, first compile the file/etc/xinetd. d/telnet, change [disable = yes] to [disable = no], and then use
[/Etc/init. d/xinetd restart] restart super daemon.
3. Use netstat-tnlp to check whether PORT 23 is enabled.
4. The Boot data is stored in/etc/rc. d/rc [0-6]. d/. You can use the ntsysv and chkconfig commands to control whether to start the service.
Example: 1. How can I check the portmap program and execute it as soon as it is started? 2. If it is started, how can I change it to not start when it is started? 3. How to immediately close this
PORTMAP service?
You can use [chkconfig -- list | grep portmap] and [runlevel] to check whether your environment and PORTMAP are started. (Runlevel can be viewed.
The current startup interface. Chkconfig can check whether the program is started or not. OFF is not started. NO .)
If it is enabled, you can use [chkconfig -- level 35 portmap off] To set whether to enable it at startup. (3 indicates the text interface and 5 indicates the graphic interface .)
You can use [/etc/init. d/portmap stop] to immediately disable the service.
The program service that needs to be started normally.
Acpid-the new version of the power module, which is usually recommended to be enabled. However, some notebook computers may not support this service, so you have to turn it off.
Atd ------- to manage a single scheduled command execution service, it should be started.
Crond ----- It is necessary to start important services in the management of job schedules.
Iptables-built-in firewall software in Linux, which can also be started.
Keytables-if your keyboard is in an informal format, the startup of this service may help you.
Network --- this is important. You need to have networks and network services.
Sshd ------ this is started by the system preset. You can remotely log on to the terminal as a text file.
Syslog-system logon file records are very important and must be started.
Xinetd ---- the super daemon.
Xfs ------- is a service used to manage X Window data. If you need X Window, this service must be started.
For other service programs, set startup as needed.