How to configure on OS Linux level to listen only localhost connections

Viewed 19

Please, advise how to configure on OS Linux level to listen to only to localhost connections. TCP and UDP services open for local interaction on my device making the device open to ssh brute-force, fuzzing, and another attack. If possible use Yocto recipe modifications. Thanks in advance for any replies.

1 Answers

If you install the firewall ufw the defaults are

  1. Allow any outgoing connections

  2. Deny any incoming connections

If you cannot install ufw, which sits on top of iptables, use it directly

iptables -P INPUT DROP
Related