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

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.