linux (centos) SPAM problem

Foreign vps, banned, and told to send spam (SPAM), the following methods to check and close the mail service process:

1. Check whether the mail service is running:

①#lsof -i:25
Check whether the mail port 25 is occupied by the process

② #netstat -anp
View all running processes, whether there is sendmail
===================================== =============================================
2. Close and open the mail port ( The essence is to close the service corresponding to the port)
①The services that are automatically started at boot in linux are generally stored in two places: Services in
the /etc/init.d/ folder: The services
in this folder can be run by running the corresponding SCRIPT to turn it on or off.
For example: start the sendmail service ./sendmail start (open the TCP 25 port)
close the sendmail service ./sendmail stop (close the TCP 25 port)

② Control the service that is automatically started at boot, avoid restarting the vps, and then start the service:
the above The method of controlling the service switch is operated after starting linux. If I want to control which services are started and which services are closed when linux starts
, there are 3 methods to control the automatic start of services:
1. Change /etc/rc.d The corresponding folder of:
  If the default interface of your login is the character interface, then modify the rc3.d folder, if the default login interface is the graphical interface, then modify the rc5.d.
  In the folder, the name of each service is preceded by "K" or "S". S means that the service will run automatically at startup. If it is deleted or the prefix is ​​changed to "K", it will not start next time. .
===================================================== ===========================

View which ports are open netstat -anp
close port number: iptables -A INPUT -p tcp --drop port number -j DROP

                 iptables -A OUTPUT -p tcp --dport port number -j DROP

open port number: iptables -A INPUT -ptcp --dport port number -j ACCEPT

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327034425&siteId=291194637