1822713 Members
3694 Online
109644 Solutions
New Discussion юеВ

Re: any port in a storm

 
SOLVED
Go to solution
Randy_9
Regular Advisor

any port in a storm

Quick question about port number assignments on UNIX...
If a process does NOT have root-level authority, which available port numbers can it use?
I was under the impression that any available port greater than 1024 could be used by a non-root process.
Is this correct? Perhaps this maximum is a configuration option, rather than a platform rule-of-thumb?
Or there's another value that's a maximum?
Is it different on AIX, Solaris, and HP UNIX variants?

Thanks,

Randy
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor
Solution

Re: any port in a storm

Hi Randy,

You can get those values using the following commands.

ndd -get /dev/tcp parameter

tcp_largest_anon_port
udp_largest_anon_port
tcp_smallest_anon_port
tcp_smallest_nonpriv_port
udp_smallest_anon_port
udp_smallest_nonpriv_port

The names are self-explanatory. The last four parameters are not supported by HP for modifications.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: any port in a storm

You CAN use any available port > 1024 but SHOULD you? In addition to the well-known ports 0-1023 there is also a range from 1024-49151 which comprise the "Registered Ports". These should be avoided because they already have a defined role. This is not to say that you can't use them.

Ideally you stay out of that territory and stay in the range 49152-65535.

http://www.iana.org/assignments/port-numbers
If it ain't broke, I can fix that.
Randy_9
Regular Advisor

Re: any port in a storm

Nothing like sticking one's toe into the pool
of wisdom and coming out a winner again.
Thanks all for the input, points assigned.

Randy
Muthukumar_5
Honored Contributor

Re: any port in a storm

Hai,

We cannot access 1-1023 ports for the non-privillages purpose using the hdd command. It is having unsupported tunable parameters as like tcp_smallest_nonpriv_port.

You can get the untunnable parameters with hdd -h unsupported -set /dev/tcp command.

We can assign the privillage porst to the service with bindresvport() call.

There is a discussion happened on this. It is at http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=620899

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!