How to block port 25

If you are not sending email from your VPS, you may want to block access to port 25. This can help prevent spam from being sent from your server.

The steps may very slightly depending on the Linux type that you are using, however the general steps will be the same. In this example we will use CentOS.

Step 1: Add iptables rules to Drop port 25

iptables -A INPUT -p tcp --dport 25 -j DROP
iptables -A OUTPUT -p tcp --dport 25 -j DROP

Step 2: Save iptables rules

service iptables save

Was this answer helpful?

 Print this Article

Also Read

How to Change VPS Timezone/Date

This is a simple process that only takes 3 lines of code via console. rm -rf /etc/localtime...

PPP Support (PPTP)

How to enable PPP support on your VPS:1. Go into the Server Management Control Panel.2. Go to...

How do I use NAT/Masquerading?

Use the following command: iptables -t nat -A POSTROUTING -j SNAT --to-source YOURVPSIP

Which Linux distributions do you offer?

We offer many different linux distributions and have both 32 and 64bit options (many more than...

WordPess OS Template

When using the "reinstall" option on your VPS in the Server Management Control Panel, you will...