Re: starting and closing tcp ports (86 Views)
Reply
Frequent Advisor
pedliz11
Posts: 104
Registered: ‎08-28-2007
Message 1 of 7 (86 Views)
Accepted Solution

starting and closing tcp ports

how do you start a tcp port for listening and /or
close a port
Please use plain text.
Honored Contributor
VK2COT
Posts: 921
Registered: ‎01-17-2006
Message 2 of 7 (86 Views)

Re: starting and closing tcp ports

Hello,

Your question is very generic. For lot
of applications, you already have ready-made
programs.

Let's take a simple example, Apachhe
httpd server is started and typically
listens on port 80...

I would suggest you read more about
Unix sockets in the first instance.

One of the references is:

http://www.unixguide.net/network/socketfaq/

STREAMS is an alternative to the Berkeley
sockets API.

STREAMS is a modular architecture for
implementing full-duplex, bidirectional
character I/O between kernel or user space
processes and device drivers.

Its most frequent uses have been in
developing terminal I/O and networking
subsystems.

All modern systems that provide STREAMS
provide sockets (Stream Sockets) too.

STREAMS is more complex than sockets, but it
provides more flexibility than sockets.

However, it is little used in modern software.

You need to learn more about programming. C,
C++, Java, Python, Perl and typically used
to write new applications that use
sockets and/or STREAMS.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Please use plain text.
Honored Contributor
Jeeshan
Posts: 2,084
Registered: ‎11-05-2007
Message 3 of 7 (86 Views)

Re: starting and closing tcp ports

Hi

basically all port numbers are defined in /etc/services file. You can enable or disable the ports from this file.

a warrior never quits
Please use plain text.
Advisor
radkol
Posts: 16
Registered: ‎06-04-2006
Message 4 of 7 (86 Views)

Re: starting and closing tcp ports

Hello,

to make TCP port listenning you need to start daemon/application which listen to that port, once started port will be opened, when you stop the application it will be closed.
Please use plain text.
Honored Contributor
Darrel Louis
Posts: 856
Registered: ‎11-27-2000
Message 5 of 7 (86 Views)

Re: starting and closing tcp ports

Hi,

With "netstat -af net" or "lsof -i" you can check for ports listening(open).
First of all you can start with /etc/inetd.conf.
Second you can start with disabling some startup scripts from starting when a server boots.
But if you want to harden your server check for Bastille, which will do all the work for you.

The /etc/services file is just a list of known ports.

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/

Please use plain text.
Honored Contributor
Steven Schweda
Posts: 9,079
Registered: ‎02-23-2005
Message 6 of 7 (86 Views)

Re: starting and closing tcp ports

> basically all port numbers are defined in
> /etc/services file. You can enable or
> disable the ports from this file.

Basically, this is wrong, although it does
seem to be a common misconception. A program
can easily listen on a port which does not
appear in /etc/services. Apache, for
example, gets its port number(s) from its own
configuration file, not from anything in
/etc/services.
Please use plain text.
Advisor
pedliz12
Posts: 39
Registered: ‎09-18-2007
Message 7 of 7 (86 Views)

Re: starting and closing tcp ports

thank you
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation