Simple ways to view and turn off Linux system services

Source: Internet
Author: User

The essence of a server is to provide access to a variety of services. Make the server run only the required services, and turn off services that are not in use. This will not only release some system resources, but also make the server more secure. For example, if you just run a simple server, you obviously don't need an X display or a desktop environment. If you do not need the Windows Network Sharing feature, you can safely close samba.

Use the following command to view services that are started with system startup:

The code is as follows:

Chkconfig--list | grep "3:on"

If the system is running SYSTEMD, execute this command:

The code is as follows:

Systemctl List-unit-files--type=service | grep enabled

Then, use the following command to turn off the service:

The code is as follows:

Chkconfig Service off

Or

The code is as follows:

Systemctl Disable Service

In the example above, replace "service" with the name of the services that you really want to stop. Examples are as follows:

The code is as follows:

Chkconfig httpd off

Or

The code is as follows:

Systemctl Disable httpd

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.