How Linux restricts the ports that users can use

for example: restrict user A to run nginx (or other services) only on specific ports (such as 8080)

Apr.01,2021

Poor user A.
I think you can just open a specific port through the firewall (iptables or firewalld)


there are two options I know so far:

  1. use selinux, to be familiar with selinux, otherwise it will make your head big
  2. use iptables-m to match packets belonging to a command or user or user group

provide these two methods. Study them

Menu