Operating System - HP-UX
1752734 Members
5684 Online
108789 Solutions
New Discussion юеВ

Re: starting and closing tcp ports

 
SOLVED
Go to solution
pedliz11
Frequent Advisor

starting and closing tcp ports

how do you start a tcp port for listening and /or
close a port
6 REPLIES 6
VK2COT
Honored Contributor

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
Jeeshan
Honored Contributor

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
radkol
Advisor

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.
Darrel Louis
Honored Contributor

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/

Steven Schweda
Honored Contributor

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.
pedliz12
Advisor
Solution

Re: starting and closing tcp ports

thank you