[CentOS] [Fwd: How to listen port under 1024 with non-root user]
Rodrigo Barbosa
rodrigob at darkover.orgThu Jul 6 01:07:20 UTC 2006
- Previous message: [CentOS] [Fwd: How to listen port under 1024 with non-root user]
- Next message: [CentOS] [Fwd: How to listen port under 1024 with non-root user]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Jul 06, 2006 at 08:56:17AM +0800, dxuranus wrote: > I make a simple mail program which need listen port 25 and 110.but i > found it's imposible , after searching with google i found non-root user > can't listen port under 1024.at first i try a script(witch lauch my > program) and use setuid but that still did't work.any way can handle > this. > Thanks for any help. Yes, that is correct. It is impossible, on the Unix model, for a non-root program to listen to a privileged port (<1024). The best solution is for the program to start as root, bind to the port, than lower its privileges using the setuid() family of functions. I particularly enjoy setreuid(). - -- Rodrigo Barbosa "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFErGJIpdyWzQ5b5ckRAvKRAKCYWoM4usgiGkNdujELoV6kXzUW0wCggcyj l7IHsLPxOjMAsSnTmVmb0ZU= =HCbi -----END PGP SIGNATURE-----
- Previous message: [CentOS] [Fwd: How to listen port under 1024 with non-root user]
- Next message: [CentOS] [Fwd: How to listen port under 1024 with non-root user]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list