System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

non-root user using TCP port

 
Kyu-Yong Kwon
Frequent Advisor

non-root user using TCP port

Dear all
I have a hp-ux 11.23 v2 server
my customer, he want to 433 port open.
because his application runing 433 port.
So, i have to open the port using non-root user.

i tried as below:
#ndd -set /dev/tcp tcp_smallest_nonpriv_port 80

but occurred an error message
=> operation failed, Invalid argument.

let me know..please...
11 REPLIES
Roopesh Francis_1
Trusted Contributor

Re: non-root user using TCP port

Hi,

add below port number to /etc/services
application identification 433/tcp.
check whether the port listening using netstat.
# netstat -an|grep 433
Jineesh
Advisor

Re: non-root user using TCP port

Hi

We use /etc/services file for mentioning the ports in the OS.

If you need the port 433, add an entry in the /etc/services file.

ftp 21/tcp # File Transfer Protocol (Control)

433/tcp

Then try to check with the application.If it doesn't work, you can use the following command to make sure that the port 433 is in listen state

#netstat -an |grep 433
Laurent Menase
Honored Contributor

Re: non-root user using TCP port

>> i tried as below:
> #ndd -set /dev/tcp tcp_smallest_nonpriv_port 80
don't do that
your system need reserved ports for nfs, rcmds ....

on 11.31 you have fine grain priviledge which can permit you to do this as you can grant to a group of user the priovilege to open a priv port.

else, the only way is to use a setuid bit, or a coprocess which bind and pass it to your application through a unix domain socket with sendmsg() and access rights.


you can do that type of thing with inetd.

you define in /etc/services
myport 443/tcp

and inetd.conf
myport stream tcp swait myuser /mydir/bin/myapplication myapplication myapplicationparams

Kyu-Yong Kwon
Frequent Advisor

Re: non-root user using TCP port

Dear all
thanks a lot.
i found it.
this is Sudo.
So, i will install sudo.

thank you
Steven Schweda
Honored Contributor

Re: non-root user using TCP port

> because his application runing 433 port.

What is "his application"?


> add below port number to /etc/services

> [...] add an entry in the /etc/services file.

> you define in /etc/services

Do you people _really_ believe that an entry
in /etc/services is needed to use a port?

> application identification 433/tcp.

> 433/tcp

> myport 443/tcp

Did anyone say that "his application" used
TCP?

"your application name"? So, Apache should have an entry like "Apache 80/tcp"?

_PLEASE_ give /etc/services a rest. It
doesn't need this kind of "help".


> this is Sudo.

That could be a good thing to use. (Better
than much of the advice which you'll see
here.)
Roopesh Francis_1
Trusted Contributor

Re: non-root user using TCP port

Hello Stephen,

What did you really mean....
can you pls brief ,what is the use of /etc/services in hp unix
Laurent Menase
Honored Contributor

Re: non-root user using TCP port

Steven is right, /etc/services alone is of no use for using ports.
- on all other system it is the same. There is no specificity on HPUX.

it is only the file used by getservbyname() to match a service name with a port number.

It is just a naming facility!

now once it is defined in /etc/services you can use in inetd.conf, and make your service start by inetd like I wrote.

But declaring it in /etc/services doesn't reserve the port, nor start a service.


Roopesh Francis_1
Trusted Contributor

Re: non-root user using TCP port

thanks
Laurent Menase
Honored Contributor

Re: non-root user using TCP port

in fact Steven didn't see apparantly that I said "define in /etc/services AND use it in inetd.conf."
Steven Schweda
Honored Contributor

Re: non-root user using TCP port

> in fact Steven didn't see apparantly that I
> said "define in /etc/services AND use it in
> inetd.conf."

No, Steven didn't think that a suggestion to
do something which might be useful improved
the other suggestion to do something useless.

And, knowing practically nothing about "his
application", I don't even know if it would
be useful to change "inetd.conf". But
perhaps you know more about it than I (with
my very weak psychic powers) know.
Laurent Menase
Honored Contributor

Re: non-root user using TCP port

it is open suggestions on how to use reserved ports. now programs can be adapted to those possibilities.