iptables is the tool you're looking for. It's run right from the shell so you don't know any gui tools or anything like that.
However I do not remember the exact syntax for opening ports using it, but I'm sure if you do a google search for "Opening Ports Using IPTABLES" or something similier I'm sure you will get your answer soon enough.
Cheers
Tap
