I want to limit port 80 so that only one user can use it. I want to do this with iptables I have not found any documentation on how to do this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you mean “a local user with a discrete uid” then you can use the owner module (
-m owner) and the--uid-owner #option.But there are some problems here:
By themselves, those might not normally be deal-breakers. But you need to effectively invert the conditional and block packets not matching the user. I suspect this will sufficiently break protocol processing that a simple attempt to do this will fail.
I would say, forward port 80 output that you know will have a user association to a separate chain, and then filter only that chain by user. This should sufficiently break other user’s traffic but not internal traffic to generally meet your requirement.