Set the vps to ban SMTP port 25 to prevent the vps from being spammed by hackers.

888u

Last update at :2024-04-29,Edit by888u


Recently, I saw someone saying that 91 Cloud's Ruisu has a backdoor and can send random emails, but it doesn't matter whether it is true or false. For us computer users, the biggest fear is that the VPS will be hacked and send random emails. This means that the hosting provider will send emails randomly every minute. The service will be deleted.

Therefore, it is necessary for us to block port 25 on our VPS to avoid being abused for sending emails. Let’s briefly talk about this topic today.

First, we must install iptables and run it correctly.


1. Block all 25 port connections

iptables -I FORWARD -p tcp --dport 25 -j DROP

2. Allow specific IP to connect to port 25

iptables -I FORWARD -s xx.xx.xx.xx -p tcp --dport 25 -j ACCEPT

3. Disable specific IP connections to port 25

iptables -I FORWARD -s xx.xx.xx.xx -p tcp --dport 25 -j DROP

4. Save and take effect

/etc/rc.d/init.d/iptables save

/etc/init.d/iptables restart


After setting the iptables rules, you need to save and restart iptables to take effect. Otherwise, the rules will become invalid after the server is restarted.


After this setting, your VPS will not be able to send outgoing emails through port 25.

Recommended site search: Zhenjiang high defense server, overseas server, fast website registration, Hong Kong vps host rental, ip proxy server, web page registration, American independent host, permanent free Linux server, high defense US server, China Domain name,

Set the vps to ban SMTP port 25 to prevent the vps from being spammed by hackers.

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码