How do I restrict ports to certain users?

view full story

http://askubuntu.com – Alright, well, what I wanted to do was to allow my users to only be allowed to access a specific port, In example, UserA can only access port 2004 While UserB can only access ports 2009, and 2010 To be more helpful, I'll try and explain. Basically, users will be allowed to remotely access the server, and call a program through SSH. The thing is, the program allows the user to type in the port to use. Is there any way to restrict users to only be able to use certain ports... I'm assuming I may have to some how modify the program so that a user can only access certain ports (and in turn some (HowTos)