Re: MacOS TCP port permissions

Liste des GroupesRevenir à cu programmer 
Sujet : Re: MacOS TCP port permissions
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : comp.unix.programmer
Date : 17. Apr 2026, 23:56:50
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <10rudri$19o$1@reader1.panix.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <87tst9s4v4.fsf@kst.eternal-september.org>,
Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
scott@slp53.sl.home (Scott Lurndal) writes:
boltar@caprica.universe writes:
[...]
Oh FFS, the hacker server would use whatever keys the hacker wanted it to
use. Do try and keep up.
>
You don't seem to have an understanding of the session
establishment protocol used by ssh, or the context of the
thread you've  butted into (context: the ability for a
non-privileged process to bind to ports below 1024).
>
In that particular scenario, the non-privleged process
cannot read the host key.  Yes, it can present a different
host key, which David pointed out may cause the client to
complain that the host key has been changed - a clear warning
to the user that the host he is attempting to log into may
have been compromised.
[...]
>
If I understand correctly, a non-root user can set up a server on a
"privileged" port, but not if that port is already in use.  If root
is already has sshd listening on port 22, a non-root user won't
be able to set up another server on the same port.  (And an ssh
server on a port other than 22 isn't going to be visible unless
someone goes looking for it.)
>
Which means, unless I'm missing something, that the warning about
a changed host key is not likely to show up.  (Unless the system
doesn't have an ssh server -- but then how does the user get
into it?)

The SSH protocol is conceptually layered into two parts: the
"SSH transport protocol", described in RFC4253, is the lower
layer protocol, and authenticates _hosts_ (see section 1 of the
RFC).  A side-effect of the host authentication exchange is
the generation of a random ephemeral encryption key suitable for
use with a symmetric cipher.

This type of authentication is based on public key cryptography.
When SSH server software is installed onto a computer, part of
the initial configuration process is generating a public/private
key pair (the "host key") that is used in the host
authentication protocol; the public key is distributed widely,
while the private key is (as the name implies) private to the
server itself.  One of the most basic mechanisms for securing
the host private key is ensuring that only the administrator can
read it.

User authentication is described in RFC4252 ("the Secure Shell
Authentication Protocol").  It is intended to be used over a
connection already host-authenticated and encrypted by the SSH
transport protocol.

You are correct that if an SSH server is already running and
bound to the well-known SSH server port (e.g., TCP port 22),
then some other programm cannot bind to that port (even if
running as root).

But suppose the SSH daemon is not running, and some random user
sets up an imposter server listening on that port.  Since
unprivileged users can bind any port (including 22), they can do
so.  But, since they presumably cannot read the file containing
the host private key, they lack the cryptographic key material
required to authenticate as the real server using the RFC4253
host authentication protocol.  Clients will notice that and
fail to establish an SSH transport protocol connection, well
before user authentication is attempted, let alone a shell or
anything similar is executed.

And even if there's no existing ssh server, a non-root sshd would
only provide access to the user's account.

Not even.  The client wouldn't be able to authenticate the
identity of the server _at all_, regardless of what user it was
running at.

More plausibly, a non-root user could set up an ftp server.

Potentially they could, though most Unix-y systems store the
user's password hashed using some one-way algorithm that is not
easily invertible, and on top of that, only allow privileged
access to the hashed passwords.  So they could set up an
imposter FTP service (who uses the insecure FTP protocol in this
day and age?!) and collect passwords the user enters, but they
could not necessarily validate that those passwords are actually
the user's real password.

- Dan C.


Date Sujet#  Auteur
16 Apr09:44 * MacOS TCP port permissions71boltar
16 Apr13:23 `* Re: MacOS TCP port permissions70Geoff Clare
16 Apr15:48  `* Re: MacOS TCP port permissions69boltar
16 Apr20:29   +* Re: MacOS TCP port permissions56Richard Kettlewell
17 Apr11:31   i`* Re: MacOS TCP port permissions55boltar
17 Apr15:04   i `* Re: MacOS TCP port permissions54Dan Cross
17 Apr15:41   i  `* Re: MacOS TCP port permissions53boltar
17 Apr16:20   i   +* Re: MacOS TCP port permissions35Dan Cross
17 Apr16:50   i   i`* Re: MacOS TCP port permissions34boltar
17 Apr17:09   i   i +* Re: MacOS TCP port permissions14Dan Cross
18 Apr11:28   i   i i`* Re: MacOS TCP port permissions13boltar
18 Apr16:06   i   i i +* Re: MacOS TCP port permissions8Dan Cross
18 Apr16:26   i   i i i`* Re: MacOS TCP port permissions7boltar
18 Apr16:48   i   i i i `* Re: MacOS TCP port permissions6Dan Cross
18 Apr16:52   i   i i i  `* Re: MacOS TCP port permissions5boltar
18 Apr16:56   i   i i i   `* Re: MacOS TCP port permissions4Dan Cross
18 Apr16:59   i   i i i    `* Re: MacOS TCP port permissions3boltar
18 Apr17:12   i   i i i     `* Re: MacOS TCP port permissions2Dan Cross
19 Apr10:02   i   i i i      `- Re: MacOS TCP port permissions1boltar
18 Apr16:58   i   i i +* Re: MacOS TCP port permissions2boltar
19 Apr00:05   i   i i i`- Re: MacOS TCP port permissions1Nuno Silva
19 Apr00:01   i   i i `* Re: MacOS TCP port permissions2Nuno Silva
19 Apr00:50   i   i i  `- Re: MacOS TCP port permissions1Dan Cross
17 Apr21:34   i   i +* Re: MacOS TCP port permissions18Keith Thompson
17 Apr22:53   i   i i+- Re: MacOS TCP port permissions1Richard Kettlewell
17 Apr23:56   i   i i+* Re: MacOS TCP port permissions11Dan Cross
18 Apr00:48   i   i ii+* Re: MacOS TCP port permissions2Keith Thompson
18 Apr02:56   i   i iii`- Re: MacOS TCP port permissions1Dan Cross
18 Apr11:39   i   i ii`* Re: MacOS TCP port permissions8boltar
18 Apr16:08   i   i ii `* Re: MacOS TCP port permissions7Dan Cross
18 Apr16:28   i   i ii  `* Re: MacOS TCP port permissions6boltar
18 Apr16:48   i   i ii   `* Re: MacOS TCP port permissions5Dan Cross
18 Apr16:55   i   i ii    `* Re: MacOS TCP port permissions4boltar
18 Apr16:57   i   i ii     `* Re: MacOS TCP port permissions3Dan Cross
19 Apr10:00   i   i ii      `* Re: MacOS TCP port permissions2boltar
19 Apr14:20   i   i ii       `- Re: MacOS TCP port permissions1Dan Cross
18 Apr11:36   i   i i`* Re: MacOS TCP port permissions5boltar
19 Apr01:54   i   i i +* Re: MacOS TCP port permissions3Keith Thompson
19 Apr10:08   i   i i i`* Re: MacOS TCP port permissions2baltar
19 Apr14:29   i   i i i `- Re: MacOS TCP port permissions1Dan Cross
19 Apr10:45   i   i i `- Re: MacOS TCP port permissions1Nuno Silva
18 Apr11:30   i   i `- Re: MacOS TCP port permissions1boltar
17 Apr20:09   i   `* Re: MacOS TCP port permissions17Richard Kettlewell
18 Apr11:32   i    `* Re: MacOS TCP port permissions16boltar
18 Apr13:02   i     `* Re: MacOS TCP port permissions15Richard Kettlewell
18 Apr15:40   i      `* Re: MacOS TCP port permissions14boltar
18 Apr16:14   i       +* Re: MacOS TCP port permissions11Kalevi Kolttonen
18 Apr16:29   i       i`* Re: MacOS TCP port permissions10boltar
18 Apr16:52   i       i +* Re: MacOS TCP port permissions3Kalevi Kolttonen
18 Apr16:57   i       i i`* Re: MacOS TCP port permissions2boltar
18 Apr16:59   i       i i `- Re: MacOS TCP port permissions1Kalevi Kolttonen
19 Apr00:24   i       i `* Re: MacOS TCP port permissions6Nuno Silva
19 Apr00:53   i       i  +* Re: MacOS TCP port permissions3Dan Cross
19 Apr17:01   i       i  i`* Running sshd on another port does have merit - even if in theory it does not (Was: MacOS TCP port permissions)2Kenny McCormack
19 Apr17:28   i       i  i `- Re: Running sshd on another port does have merit - even if in theory it does not1Kalevi Kolttonen
19 Apr10:03   i       i  `* Re: MacOS TCP port permissions2boltar
19 Apr10:26   i       i   `- Re: MacOS TCP port permissions1Nuno Silva
18 Apr17:07   i       +- Re: MacOS TCP port permissions1Richard Kettlewell
18 Apr23:36   i       `- Re: MacOS TCP port permissions1Lawrence D’Oliveiro
17 Apr00:23   +* Re: MacOS TCP port permissions11Lawrence D’Oliveiro
17 Apr00:34   i+- Re: MacOS TCP port permissions1Keith Thompson
17 Apr01:00   i+- Re: MacOS TCP port permissions1Nuno Silva
17 Apr08:12   i+* Re: MacOS TCP port permissions6Nicolas George
17 Apr08:54   ii`* Re: MacOS TCP port permissions5Richard Kettlewell
17 Apr14:49   ii `* Re: MacOS TCP port permissions4Nicolas George
17 Apr15:50   ii  +- Re: MacOS TCP port permissions1Dan Cross
18 Apr09:22   ii  `* Re: MacOS TCP port permissions2Nuno Silva
18 Apr17:09   ii   `- Re: MacOS TCP port permissions1Dan Cross
17 Apr11:31   i`* Re: MacOS TCP port permissions2boltar
17 Apr23:53   i `- Re: MacOS TCP port permissions1Lawrence D’Oliveiro
17 Apr15:58   `- Goodbye, Privileged Ports! [was Re: MacOS TCP port permissions]1Dan Cross

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal