D
D
den199482017-11-04 01:09:52
iptables
den19948, 2017-11-04 01:09:52

How to create a rule to close all ufw ports?

Only the main ports for LAMP, sftp, samba are open on ufw.
How can I close all other ports? With the help of the rule, or what is better?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-11-04
@den19948

Quite simply. First you need to disable ufw:
Next, we define the default policy as "everything that is not allowed is prohibited":
Then we open the ports that are needed:
Turn ufw back on:
Everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question