Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to view and disable Linux system services

Shulou Source: shulou.com Published: 2022-06-01 15:46:27 11月11日 Update

This article introduces the knowledge of "how to view and shut down Linux system services". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The essence of the server is to provide access to various services. Make the server run only the required services and shut down the unused services. Doing so not only frees up some system resources, but also makes the server more secure. For example, if you're just running a simple server, you obviously don't need an X-ray display or desktop environment. If you do not need the Windows network sharing feature, you can safely turn off Samba.

Use the following command to view the 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 shut down the service:

The code is as follows:

Chkconfig service off

Or

The code is as follows:

Systemctl disable service

In the above example, replace "service" with the name of the service 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

This is the end of "how to View and disable Linux system Services". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Services code systems servers commands facets runs content functions more knowledge utility security learning and then examples just names dilemmas examples Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi vpn Linux NVidia Docker