1. Home
  2. Knowledge Base
  3. Other
  4. How to Block Ports in Linux

So you’ve just purchased your brand new server and a few days later, your service provider sends you an email saying that a particular port is being abused and you need to block it.

In Linux, it’s really easy and even simpler using QuickBox Pro as well. In this guide, we’ll show the 2 commands you need to use to block any port that you choose.

Blocking the Ports

  1. SSH into your Server
  2. Then run the following command
sudo su -

3. Now that your permissions have been elevated correctly, you can now enter the following command

iptables -I INPUT -p tcp --dport <port number> -j REJECT && ip6tables -I INPUT -p tcp --dport <port number> -j REJECT

Where you see <port number> enter in the number of the port you wish to block.

The command port we hear from users that needs to be blocked is port 111. You can simply copy and paste the command below for this port

iptables -I INPUT -p tcp --dport 111 -j REJECT && ip6tables -I INPUT -p tcp --dport 111 -j REJECT

Was this article helpful?

Related Articles

Guidelines

Please add bugs found in QuickBox Pro using this template:

Bug Report
Select Bug Report as the issue template

Please add feature requests for application inclusion in QuickBox Pro using this template:

Application Feature Request
Select Application Feature Request as the issue template

Please add feature requests for general QuickBox Pro using this template:

Select General Feature Request as the issue template
Select General Feature Request as the issue template

Viewing issues as well as feature requests does not require an account.

You will need to create an account on our Lab in order to post both Issues as well as Feature Requests.
You can register an account here if you do not already have one.

We look forward to your reports as well as your ideas and suggestions for ongoing developments to the QuickBox Pro software!

The QuickBox Pro Community Appreciation Day Event Sale is in full effect.
Get your savings on!
00
Days
00
Hours
00
Minutes
00
Seconds