Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need bsd authpf like tool for Linux. The user should authenticate himself through ssh or some web application and iptables rules specified for the user will be executed after authentication in my plan.

Can you suggest me some pointers to start.


share|improve this question
up vote 1 down vote accepted

You could code something like this yourself. The /etc/sudoers file would be a great resource, but I think fundamentally what you are looking for is:

It adds user based authentication to IPtables rules. So only after a user has authenticated will they be able to get past your firewall.

share|improve this answer

You can also use the .bashrc or .bash_profile files in the home folder of the user.

Every time a user logs in, bash (if in use) will read those files (don't know the order).

You can place your iptables rules there. Every user has it's own.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.