Super User is a question and answer site for computer enthusiasts and power users. 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 to be able to assign specific ports to a given user to listen at. Say I have user X, I want him to be able to only listen on port 500. User Y only on port 501. How can I do this? Im working on a debian lenny.

Edit: User X and Y should not be able to touch any other port, not assigned to them, within a given range. (like port 100-1000)

share|improve this question
1  
I think you need to provide a lot more background information here. – Zoredache Sep 28 '11 at 21:45
up vote 1 down vote accepted

Non root users cannot listen (or even open) ports below 1024.

To restrict users to other single ports above 1024, you can use the --uid-owner option of iptables. See "man iptables".

If you dont want to mess with iptables yourself (but still have a decent knowledge of networking/firewalling), my personal favourite firewalling solution is firehol. It has user/uid commands to help you set up per-user restrictions.

http://firehol.sourceforge.net/

share|improve this answer
    
sorry about the confusion about the ports below 1024. I just picked a bad range. Anyway, I cant assign them a range with iptables/firehol? – pharno Sep 29 '11 at 9:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .