Operating System - HP-UX
1834009 Members
2840 Online
110063 Solutions
New Discussion

Re: How to enable protected TCP port for non-root user?

 
Davor Bira?
Frequent Advisor

How to enable protected TCP port for non-root user?

Hello,

my question is how to enable protected port(<1024) for use of non-root user?

Thanks
7 REPLIES 7
RAC_1
Honored Contributor

Re: How to enable protected TCP port for non-root user?

For using ports bellow 1024, you need to be root.

If you want to give access to a non-root user to use port bellow, you can use program sudo. Here a non-root user invokes a program through sudo. But he cant access the port directly.
There is no substitute to HARDWORK
Vijaya Kumar_3
Respected Contributor

Re: How to enable protected TCP port for non-root user?

I dont thing there is a direct way to do this. But i am not sure.

Anyway, you can use Sudo setup for the user to run the command as user root. Or you can also look for Sticky bit setup for the command that acquires the port (Dangerous though)

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
T G Manikandan
Honored Contributor

Re: How to enable protected TCP port for non-root user?

Use 'sudo' to execute the command as super user to use ports < 1024
Mark Grant
Honored Contributor

Re: How to enable protected TCP port for non-root user?

It can't be done. The only alternative is to use SETUID bit on the permissions on the program you want to use the port and it has to be owned by root. The simplest way of achieving that, as mentioned above, is to use "sudo".
Never preceed any demonstration with anything more predictive than "watch this"
Vijaya Kumar_3
Respected Contributor

Re: How to enable protected TCP port for non-root user?

I am sorry , it is Setuid not Sticky bit.

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Fabio Ettore
Honored Contributor

Re: How to enable protected TCP port for non-root user?

Hi Davor,

ports < 1024 are privileged ports and the only root user can work on those ports.
Other suggestions about Sudo and Setuid (as Vijay said!) could be a workaround...

ALI NEZNAM KAKO ONO RADI! :-)
just a little of Croatian

Best regards,
Ettore
WISH? IMPROVEMENT!
rick jones
Honored Contributor

Re: How to enable protected TCP port for non-root user?

alas, there is an 11.X ndd setting that changes the boudnaries of the "protected" port space. It is tcp_smallest_nonpriv_port and defaults to 1024.

Note, this ndd tunable is I believe _unsupported_. Abandon all hope ye who travle there :)


there is no rest for the wicked yet the virtuous have no pillows