2 thoughts on “Disable or Enable SSH Root Login and Secure SSH Access in CentOS 7”

    • Yes, you can disable specific ports on a specific user.

      Check your user id using:

      id username

      Replace username with the actual username.

      For example, to block a local user to access outgoing port 25 use:

      iptables -t filter -A OUTPUT -p tcp --dport 25 --match owner --uid-owner 501 -j DROP

      Replace 501 with the actual user id.

      For more help about this, run:

      iptables -m owner --help


Leave a Comment