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