[nSLUG] Open port on Ubuntu box

Steve Muise muisesg at gmail.com
Fri Jul 20 12:39:58 ADT 2007

> I have been trying to connect to an Ubuntu box through a given port
> (let's take 10001  for example).  I have not been able to do so, but I
> can easily SSH into it and see what I need to see.  I assume that the
> firewall is not preventing me since I can get in through port 22.

If you think there is already a service running on the box on the port, 
you can log into the box and type this to check

netstat -nap --inet | grep :10001

if there is, try telent hostname 10001, many service will at least 
answer telnet

if you are not logged in you can check the port with nmap

nmap hostname -p 10001

>> How can I open a port
>> through my SSH session (terminal session)?  What is the appropriate set
>> of commands?

if there is nothing running on the port and you want to run something on 
it for testing and you can ssh to the box, try netcat
ssh in and type

nc -l -p 10001

then from a second shell telnet to the box on port 10001 as described 
above , type some characters and press enter, whatever you type should 
show up on your ssh terminal.

Hope this is helpful

More information about the nSLUG mailing list