in reply to Writing an rsh client (Moved from Q&A)

The reason for the check on port number is that generally any user can choose a high port number, but below 1024 is reserved to root. So if you come from a low port you at least have special permisions.

Incidentally this is why many standard protocols are below 1024. For instance ftp on 21, http on 80, imap3 on 220, https on 443 and so on. (On many *nix systems you can look at /etc/services to find these numbers - I certainly cannot recite these off of the top of my head! :-)

  • Comment on Re (tilly) 1: Writing an rsh client (Moved from Q&A)

Replies are listed 'Best First'.
RE: Re (tilly) 1: Writing an rsh client (Moved from Q&A)
by merlyn (Sage) on Aug 26, 2000 at 16:50 UTC
    Beware though: this is a false sense of security if you trust this. Nowadays, anyone can throw a Linux/BSD box on the net, and be "root". And PCs never had this lame "restriction" (after all, you are "root" in DOS).

    Also, the numbering works like so:

    • Ports below 1000 are reserved to root
    • Ports above 1023 were given to users
    • Ports between 1000 and 1023 are ambiguous
    Why the gap? Because the RFC said "1K", and different manufacturers implemented it differently! Some presumed 1000, others presumed 1024. Amazing, huh?

    -- Randal L. Schwartz, Perl hacker