Linux service start and disable and corresponding port number

Source: Internet
Author: User
Linux service start and disable and corresponding port number-Linux Enterprise Application-Linux server application information. The following is a detailed description. /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.

1. stand alone (independently started) and super daemon (super Service)

1. 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;

2. 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.

II,
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?

Answer: 1. 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 .)
2. 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 .)
3. You can use [/etc/init. d/portmap stop] to immediately disable the service.

3. Normal program services to be started.
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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.