Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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.