- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Open a port
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 11:28 PM
тАО06-23-2004 11:28 PM
How to bind a process to a port less than 1025 with a NON root account?
I need it for a SAP portal: default web port is 50000 and I need it on port 80. Tha java user (UID 103) that should start SAP web server (not Apache, iPlanet....) shows:
Unable to create server socket.
Perhaps another process is using port 80.
Nobody is using port 80: the problem is related to the user privilege, but I do not want to run it as root!
Regards,
Simone
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 11:38 PM
тАО06-23-2004 11:38 PM
Re: Open a port
Check if port 80 is disabled/commented out in the /etc/services file.
# grep 80 /etc/services
http 80/tcp www # World Wide Web HTTP
http 80/udp www # World Wide Web HTTP
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 11:43 PM
тАО06-23-2004 11:43 PM
Re: Open a port
services file is still the default one with:
http 80/tcp www # World Wide Web HTTP
http 80/udp www # World Wide Web HTTP
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 11:48 PM
тАО06-23-2004 11:48 PM
Re: Open a port
#http 80/tcp www # World Wide Web HTTP
#http 80/udp www # World Wide Web HTTP
use lsof -i | grep 80
to check if someone is using these ports.
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 11:57 PM
тАО06-23-2004 11:57 PM
Re: Open a port
We can use the bindresvport(3N) call to bind on the privillaged port. Check the port 80 is in usage with netstat call.
Check the successful of bind with it's return type.
Regards,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 12:05 AM
тАО06-24-2004 12:05 AM
Re: Open a port
Nobody is using port 80: the problem is that I can not bind such port to a process with a non-root user.
Muthukumar: how can I use bindresvport?
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 03:48 PM
тАО06-24-2004 03:48 PM
Re: Open a port
Create a socket with the socket call. Use the struct sockaddr_in from netinet/in.h to know it's format.
bindresvport will work as like in the http://www.linuxtv.org/cgi-bin/cvsweb.cgi/dietlibc/librpc/bindresvport.c?rev=1.4 example.
It will try to bind in the reserved ports. Assign the port to 80 and check for it.
Regards,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 04:00 PM
тАО06-24-2004 04:00 PM
Re: Open a port
Now, what is typically done is to launch an application as root, allocate the socket, bind it to the privildeged port, and then change from root to non-root.
If the application cannot start as root, it will have to use a non-priviledged port. Period.
Now, having said that, the system admistrator (aka root) can use ndd (11.X) to change the range of ports that are priviledged - iirc the setting is called tcp_smallest_nonpriv_port or somesuch. But only root can do that.
Just why do you "need" it to be port 80? Do you have software that is broken and thinks that http is only ever to port 80 or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 05:43 PM
тАО06-24-2004 05:43 PM
Re: Open a port
use ndd: ndd -set /dev/tcp tcp_smallest_nonpriv_port 80
Don't forget to edit your /etc/rc.config.d/nddconf
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_smallest_nonpriv_port
NDD_VALUE[0]=80
#(Don't forget to increment the index number, in the example above it is 0, but make it one higher than the highest index number in your nddconf file.
Note however that doing this will reduce security since your priveleged ports are no longer priveleged. However this really isn't a big deal since this isn't much of a security measure anyway.
It would be nice if HP-UX could allow a way for Admins to make a single exception to the priveleged port dilema. Wouldn't it be nice if you could have a list of ports in the priveleged range that were NOT priveleged, such as 80. That way, you wouldn't have to go through the process of switching users once you had the port opened. How about a feature request???
- Andrew Gray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 05:44 PM
тАО06-24-2004 05:44 PM
Re: Open a port
- Andrew Gray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 10:32 PM
тАО06-24-2004 10:32 PM
Re: Open a port
Thanks to all answers (points will surely follow), but ndd fails with this error:
# ndd -set /dev/tcp tcp_smallest_nonpriv_port 80
operation failed, Invalid argument
(Note that kernel parameter STRMSGSZ is 65535: should be enough).
Is it possible to set this tcp parameter?
Regards,
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 10:40 PM
тАО06-24-2004 10:40 PM
Re: Open a port
have you already seen this doc in ITRC knoledge base?
KBRC00012155 - ndd -get & -set error message: invalid argument operation failed
It seems that you should have STRMSGSZ equal to 0 in order to change that parameter.
HTH.
Best regards,
Ettore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 10:55 PM
тАО06-24-2004 10:55 PM
SolutionOperation of
# ndd -set /dev/tcp tcp_smallest_nonpriv_port 80 will be like
operation failed, Invalid argument..,
because it is UNSUPPORTED ndd tunable parameters on HP-UX.
Execute the command as like
# ndd -h unsupported | grep priv
It can not be tuned with that command. The way you can use the bindresvport() command.
=== man page ===
The bindresvport() function binds a socket descriptor to a privileged
IP port; that is, a port number in the range 0 to 1023
================
Regards,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 11:03 PM
тАО06-24-2004 11:03 PM
Re: Open a port
Even with STRMSGSZ=0 the problem is the same:
# kmtune |grep STRMSGSZ
STRMSGSZ 0 - 0
#ndd -set /dev/tcp tcp_smallest_nonpriv_port 80
operation failed, Invalid argument
Are you sure this is a configurable tcp parameter?
Simone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2004 11:19 AM
тАО06-27-2004 11:19 AM
Re: Open a port
Yes, you're right, it doesn't work does it. I don't know why, I was only going by the documentation from HP (see attached). I'm out of ideas. Anyone else?
- Andrew Gray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2004 02:50 PM
тАО06-27-2004 02:50 PM
Re: Open a port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2004 03:42 PM
тАО06-27-2004 03:42 PM
Re: Open a port
- Andrew Gray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 02:32 AM
тАО06-28-2004 02:32 AM
Re: Open a port
BTW, what is the reason you cannot have this thing listening on port 50000 like its default again?