Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Chemist who falls in acid will be tripping for weeks.


computers / comp.os.linux.misc / Guaranteeing SSH access to specific clients

SubjectAuthor
* Guaranteeing SSH access to specific clientsHarold Johanssen
+* Re: Guaranteeing SSH access to specific clientsDavid W. Hodgins
|+* Re: Guaranteeing SSH access to specific clientsHarold Johanssen
||+- Re: Guaranteeing SSH access to specific clientsDavid W. Hodgins
||+- Re: Guaranteeing SSH access to specific clientsRobert Heller
||+- Re: Guaranteeing SSH access to specific clientsstepore
||+* Re: Guaranteeing SSH access to specific clientsCarlos E.R.
|||`- Re: Guaranteeing SSH access to specific clients26C.Z969
||+- Re: Guaranteeing SSH access to specific clientsHenning Hucke
||+- Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
||`* Re: Guaranteeing SSH access to specific clientsAllodoxaphobia
|| `- Re: Guaranteeing SSH access to specific clientsPancho
|`* Re: Guaranteeing SSH access to specific clientsRobert Heller
| `* Re: Guaranteeing SSH access to specific clientsAndreas Kohlbach
|  `- Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
+- Re: Guaranteeing SSH access to specific clientsAndreas Kohlbach
+- Re: Guaranteeing SSH access to specific clientsRichard Kettlewell
+- Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
`* Re: Guaranteeing SSH access to specific clientsHarold Johanssen
 `* Re: Guaranteeing SSH access to specific clientsTauno Voipio
  +* Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
  |`* Re: Guaranteeing SSH access to specific clientsRobert Heller
  | `* Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
  |  +- Re: Guaranteeing SSH access to specific clientsRobert Heller
  |  +* Re: Guaranteeing SSH access to specific clientsPancho
  |  |`- Re: Guaranteeing SSH access to specific clientsPancho
  |  `* Re: Guaranteeing SSH access to specific clientsAndreas Kohlbach
  |   `* Re: Guaranteeing SSH access to specific clientsRobert Heller
  |    `* Re: Guaranteeing SSH access to specific clientsCarlos E.R.
  |     `* Re: Guaranteeing SSH access to specific clientsRobert Heller
  |      `* Re: Guaranteeing SSH access to specific clientsCarlos E.R.
  |       +- Re: Guaranteeing SSH access to specific clientsPancho
  |       `* Re: Guaranteeing SSH access to specific clientsRichard Kettlewell
  |        `- Re: Guaranteeing SSH access to specific clientsCarlos E. R.
  `* Re: Guaranteeing SSH access to specific clientsHarold Johanssen
   `* Re: Guaranteeing SSH access to specific clientsThe Natural Philosopher
    `- Re: Guaranteeing SSH access to specific clientsTed Heise

Pages:12
Guaranteeing SSH access to specific clients

<tmtf02$1ufi$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10862&group=comp.os.linux.misc#10862

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!fs4vz7lwhQCwq5L3H1slGg.user.46.165.242.75.POSTED!not-for-mail
From: noemail@please.net (Harold Johanssen)
Newsgroups: comp.os.linux.misc
Subject: Guaranteeing SSH access to specific clients
Date: Thu, 8 Dec 2022 19:47:14 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tmtf02$1ufi$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="63986"; posting-host="fs4vz7lwhQCwq5L3H1slGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Harold Johanssen - Thu, 8 Dec 2022 19:47 UTC

I don't know whether this is reasonable possible, but I thought
I'd ask anyway, just in case:

Is it possible to guarantee SSH to a specific client, to the
exclusion of all other clients? In effect, all other connection would be
immediately rejected, even before the SSH protocol exchange gets going.
The following requirements must be met:

- The SSH server must be listening on port 22.
- The target client may connect from different, arbitrary IP
addresses.

This would be easily possible with tweaked SSH servers and
clients, but I am not sure it can be done with off-the-shelf ones.

Re: Guaranteeing SSH access to specific clients

<op.1wvne71ia3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10863&group=comp.os.linux.misc#10863

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Thu, 08 Dec 2022 16:31:45 -0500
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <op.1wvne71ia3w0dxdave@hodgins.homeip.net>
References: <tmtf02$1ufi$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="a8af1b8eb50cf24829d2c58c62ba7d88";
logging-data="1016480"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ComhsRe5nQxR8FPO4I20o2zU4xXZtnCY="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:5ERoxWJQJrqlExcVYbjchRnHy84=
 by: David W. Hodgins - Thu, 8 Dec 2022 21:31 UTC

On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen <noemail@please.net> wrote:

> I don't know whether this is reasonable possible, but I thought
> I'd ask anyway, just in case:
>
> Is it possible to guarantee SSH to a specific client, to the
> exclusion of all other clients? In effect, all other connection would be
> immediately rejected, even before the SSH protocol exchange gets going.
> The following requirements must be met:
>
> - The SSH server must be listening on port 22.
> - The target client may connect from different, arbitrary IP
> addresses.
>
> This would be easily possible with tweaked SSH servers and
> clients, but I am not sure it can be done with off-the-shelf ones.

Excluding all other clients would go against the fact that linux is a multi-user
system, so it's not a standard feature.

killing the sshd server does not kill the working ssh connection(s), so you could
have a script run on login via ssh that kills the sshd server, but you'd have
to also figure out how to restart it after that connection ends (intentionally
or not).

Why do you want to do this? There's probably a better way to lock things when
needed.

Regards, Dave Hodgins

Re: Guaranteeing SSH access to specific clients

<tmu2hq$18b6$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10864&group=comp.os.linux.misc#10864

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!fs4vz7lwhQCwq5L3H1slGg.user.46.165.242.75.POSTED!not-for-mail
From: noemail@please.net (Harold Johanssen)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 01:20:58 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tmu2hq$18b6$1@gioia.aioe.org>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="41318"; posting-host="fs4vz7lwhQCwq5L3H1slGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Harold Johanssen - Fri, 9 Dec 2022 01:20 UTC

On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:

> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
> <noemail@please.net> wrote:
>
>> I don't know whether this is reasonable possible, but I thought
>> I'd ask anyway, just in case:
>>
>> Is it possible to guarantee SSH to a specific client, to the
>> exclusion of all other clients? In effect, all other connection would
>> be immediately rejected, even before the SSH protocol exchange gets
>> going. The following requirements must be met:
>>
>> - The SSH server must be listening on port 22.
>> - The target client may connect from different, arbitrary IP
>> addresses.
>>
>> This would be easily possible with tweaked SSH servers and
>> clients, but I am not sure it can be done with off-the-shelf ones.
>
> Excluding all other clients would go against the fact that linux is a
> multi-user system, so it's not a standard feature.
>
> killing the sshd server does not kill the working ssh connection(s), so
> you could have a script run on login via ssh that kills the sshd server,
> but you'd have to also figure out how to restart it after that
> connection ends (intentionally or not).
>
> Why do you want to do this? There's probably a better way to lock things
> when needed.
>
> Regards, Dave Hodgins

You misunderstood what I wrote. What I meant is the following:

I want to ssh into a specific system that I control, from
wherever I am in the Internet. Any ssh connections from anybody else into
that system, wherever they are coming from in the Internet, are
automatically rejected - it is not that they are rejected when the wrong
username and password are supplied; rather, their connection requests are
rejected before the ssh protocol gets started. Can this be done, with the
constraints that I specified?

This would be networking-related question: in a nutshell, if the
TCP connection on port 22 is coming from me then it is forwarded to the
ssh daemon; otherwise, it is dropped immediately. The problem is, how
would the TCP code in my server know that the connection is coming me
from me, as opposed to anybody else?

Re: Guaranteeing SSH access to specific clients

<op.1wv1us01a3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10865&group=comp.os.linux.misc#10865

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dwhodgins@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Thu, 08 Dec 2022 21:43:30 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <op.1wv1us01a3w0dxdave@hodgins.homeip.net>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="2508d8b9ebe62355280aed74a9add54b";
logging-data="1141266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lWrVOn/Sqmr/mZC9zqLaf07Iyd40P0R8="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:gOZH3692piIMj2xXIgMZXNt2cnA=
 by: David W. Hodgins - Fri, 9 Dec 2022 02:43 UTC

On Thu, 08 Dec 2022 20:20:58 -0500, Harold Johanssen <noemail@please.net> wrote:
> I want to ssh into a specific system that I control, from
> wherever I am in the Internet. Any ssh connections from anybody else into
> that system, wherever they are coming from in the Internet, are
> automatically rejected - it is not that they are rejected when the wrong
> username and password are supplied; rather, their connection requests are
> rejected before the ssh protocol gets started. Can this be done, with the
> constraints that I specified?
>
> This would be networking-related question: in a nutshell, if the
> TCP connection on port 22 is coming from me then it is forwarded to the
> ssh daemon; otherwise, it is dropped immediately. The problem is, how
> would the TCP code in my server know that the connection is coming me
> from me, as opposed to anybody else?

See https://linuxhandbook.com/ssh-disable-password-authentication/
(keep the ssh key on a usb stick for your use), and also add
https://www.howtogeek.com/442733/how-to-use-port-knocking-on-linux-and-why-you-shouldnt/

Never rely on just port knocking.

The only other way I can see it being done is if you know in advance what ip
addresses you'll be connecting from, then add rules to allow it when needed.

Regards, Dave Hodgins

Re: Guaranteeing SSH access to specific clients

<87zgbxs15q.fsf@usenet.ankman.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10867&group=comp.os.linux.misc#10867

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ank@spamfence.net (Andreas Kohlbach)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Thu, 08 Dec 2022 22:31:45 -0500
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <87zgbxs15q.fsf@usenet.ankman.de>
References: <tmtf02$1ufi$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e781e4e81e10332bbfefa3dad878b889";
logging-data="1144738"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z2P2Zkzstwv31/swSWmFE"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:fHWhtI7FhqE1pf6mgW75A2XT7xg=
sha1:5B/jMc4HaOgrljbyqzhPP0HipHU=
 by: Andreas Kohlbach - Fri, 9 Dec 2022 03:31 UTC

On Thu, 8 Dec 2022 19:47:14 -0000 (UTC), Harold Johanssen wrote:
>
> I don't know whether this is reasonable possible, but I thought
> I'd ask anyway, just in case:
>
> Is it possible to guarantee SSH to a specific client, to the
> exclusion of all other clients? In effect, all other connection would be
> immediately rejected, even before the SSH protocol exchange gets going.
> The following requirements must be met:
>
> - The SSH server must be listening on port 22.
> - The target client may connect from different, arbitrary IP
> addresses.
>
> This would be easily possible with tweaked SSH servers and
> clients, but I am not sure it can be done with off-the-shelf ones.

I can think of several ways.

The sshd_config (probably in /etc/ssh/sshd_config) knows

AllowUsers user1

If this entry exists, only user1 can login.

Then there is

ListenAddress

so SSH will only listen to the IP following.

There is also the good old /etc/hosts.allow and /etc/hosts.deny

In the deny you could add

sshd: ALL

and in the allow only those IP(s) to grant access.

Personally I only use AllowUsers in the /etc/ssh/sshd_config which
works. Thus other users I have on the system cannot access via SSH, even
if provided the correct password.

After altering the config you need to restart the SSH-Server.

Alternatively (or use all of the options if paranoid) there are "host
keys". Users identify with their unique "host key" and don't need to
provide a password. One could even deactivate password auth. Then no user
can log in, even if provided the correct password. Their host key(s) must
match instead.
--
Andreas

Re: Guaranteeing SSH access to specific clients

<mMicnffNIKpVMQ_-nZ2dnZfqnPadnZ2d@giganews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10868&group=comp.os.linux.misc#10868

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 09 Dec 2022 03:34:32 +0000
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.15)
Subject: Re: Guaranteeing SSH access to specific clients
In-Reply-To: <op.1wvne71ia3w0dxdave@hodgins.homeip.net>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net>
Newsgroups: comp.os.linux.misc
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <mMicnffNIKpVMQ_-nZ2dnZfqnPadnZ2d@giganews.com>
Date: Fri, 09 Dec 2022 03:34:32 +0000
Lines: 46
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-54tt9UA4DPbnQHM03vCbrAgnPX0W3+a3EWnY61k1VBU8TU+cZAoqdFmhNOOTYPtwXmq/m1YplgowVbb!FS5cyDMDAndlMvPsg3Ozr4NlSrbj+q7OajD3QN0krB8m+y75d/0d5V8m8LKuTZPrv4ZK6hrAoOUz!Kwo=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Robert Heller - Fri, 9 Dec 2022 03:34 UTC

If the accepted clients have specific, known IP addresses, then if the server
has a firewall (eg iptables, firewalld, etc.), then firewall rules could be
set up to "reject" (or drop) port 22 packets from non-accepted IP addresses.
No changes to sshd or special settings in /etc/ssh/*config would be needed.

At Thu, 08 Dec 2022 16:31:45 -0500 "David W. Hodgins" <dwhodgins@nomail.afraid.org> wrote:

>
> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen <noemail@please.net> wrote:
>
> > I don't know whether this is reasonable possible, but I thought
> > I'd ask anyway, just in case:
> >
> > Is it possible to guarantee SSH to a specific client, to the
> > exclusion of all other clients? In effect, all other connection would be
> > immediately rejected, even before the SSH protocol exchange gets going.
> > The following requirements must be met:
> >
> > - The SSH server must be listening on port 22.
> > - The target client may connect from different, arbitrary IP
> > addresses.
> >
> > This would be easily possible with tweaked SSH servers and
> > clients, but I am not sure it can be done with off-the-shelf ones.
>
> Excluding all other clients would go against the fact that linux is a multi-user
> system, so it's not a standard feature.
>
> killing the sshd server does not kill the working ssh connection(s), so you could
> have a script run on login via ssh that kills the sshd server, but you'd have
> to also figure out how to restart it after that connection ends (intentionally
> or not).
>
> Why do you want to do this? There's probably a better way to lock things when
> needed.
>
> Regards, Dave Hodgins
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: Guaranteeing SSH access to specific clients

<kMicnZw0lY9VMQ_-nZ2dnZfqnPadnZ2d@giganews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10869&group=comp.os.linux.misc#10869

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 09 Dec 2022 03:34:32 +0000
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.15)
Subject: Re: Guaranteeing SSH access to specific clients
In-Reply-To: <tmu2hq$18b6$1@gioia.aioe.org>
References: <tmtf02$1ufi$1@gioia.aioe.org>??<op.1wvne71ia3w0dxdave@hodgins.homeip.net>
<tmu2hq$18b6$1@gioia.aioe.org>
Newsgroups: comp.os.linux.misc
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <kMicnZw0lY9VMQ_-nZ2dnZfqnPadnZ2d@giganews.com>
Date: Fri, 09 Dec 2022 03:34:32 +0000
Lines: 73
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-z9OKmWcMHEB7WqFLt1b75v1Wqto4V9+5DEtZvcatdR3b9fD+I0ZrhqE14S6qKbWk9MKqSK9lEdrXTHq!dlJPIx0LjvPJqKRY6ma9io8Jc7SH8WD7kJQwP5Xv6D5tlFZz/8HbztLXDWXaIfgm/U2op+zWFqge!qnI=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 4791
 by: Robert Heller - Fri, 9 Dec 2022 03:34 UTC

At Fri, 9 Dec 2022 01:20:58 -0000 (UTC) Harold Johanssen <noemail@please.net> wrote:

>
> On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:
>
> > On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
> > <noemail@please.net> wrote:
> >
> >> I don't know whether this is reasonable possible, but I thought
> >> I'd ask anyway, just in case:
> >>
> >> Is it possible to guarantee SSH to a specific client, to the
> >> exclusion of all other clients? In effect, all other connection would
> >> be immediately rejected, even before the SSH protocol exchange gets
> >> going. The following requirements must be met:
> >>
> >> - The SSH server must be listening on port 22.
> >> - The target client may connect from different, arbitrary IP
> >> addresses.
> >>
> >> This would be easily possible with tweaked SSH servers and
> >> clients, but I am not sure it can be done with off-the-shelf ones.
> >
> > Excluding all other clients would go against the fact that linux is a
> > multi-user system, so it's not a standard feature.
> >
> > killing the sshd server does not kill the working ssh connection(s), so
> > you could have a script run on login via ssh that kills the sshd server,
> > but you'd have to also figure out how to restart it after that
> > connection ends (intentionally or not).
> >
> > Why do you want to do this? There's probably a better way to lock things
> > when needed.
> >
> > Regards, Dave Hodgins
>
> You misunderstood what I wrote. What I meant is the following:
>
> I want to ssh into a specific system that I control, from
> wherever I am in the Internet. Any ssh connections from anybody else into
> that system, wherever they are coming from in the Internet, are
> automatically rejected - it is not that they are rejected when the wrong
> username and password are supplied; rather, their connection requests are
> rejected before the ssh protocol gets started. Can this be done, with the
> constraints that I specified?
>
> This would be networking-related question: in a nutshell, if the
> TCP connection on port 22 is coming from me then it is forwarded to the
> ssh daemon; otherwise, it is dropped immediately. The problem is, how
> would the TCP code in my server know that the connection is coming me
> from me, as opposed to anybody else?

Only the SSH server can know it is from you. You could disable password
authenific ation and force RSA public/private key authentification -- this
will kill brute-force password attacks (or actually make them ineffective and
avoid wasting time hashing "guessed" passwords). That is the best you can do.
The only check possible IS the SSH authentification process. Since you might
be connecting from "anywhere", IP-level firewalling won't work. At the initial
connection level there is no "knowledge" as to who is connecting. The sshd
process uses its authentification exchange process to determing "who" is
connecting and if they are really who they say they are (eg username [who] and
password/keys/etc. authentificate the connection).

>
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: Guaranteeing SSH access to specific clients

<tmuacf$131hg$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10870&group=comp.os.linux.misc#10870

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: stepore@be.here.now (stepore)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Thu, 8 Dec 2022 19:34:37 -0800
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <tmuacf$131hg$1@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Dec 2022 03:34:39 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="74f21ab63988d47ed5f7f3796c4a0635";
logging-data="1148464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uSM0+1luSysLI2I9QhCom"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:z72XsBcgNzc0VZ5mk9AyVlX0zJY=
Content-Language: en-US
In-Reply-To: <tmu2hq$18b6$1@gioia.aioe.org>
 by: stepore - Fri, 9 Dec 2022 03:34 UTC

On 12/8/22 17:20, Harold Johanssen wrote:

> This would be networking-related question: in a nutshell, if the
> TCP connection on port 22 is coming from me then it is forwarded to the
> ssh daemon; otherwise, it is dropped immediately. The problem is, how
> would the TCP code in my server know that the connection is coming me
> from me, as opposed to anybody else?

This has nothing at all to do with ssh.

It's possible with iptables but you'd had to know your IP in advance.

Can also be done with TCPwrappers.
/etc/hosts.allow
/etc/hosts.deny

<https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sect-security_guide-tcp_wrappers_and_xinetd-tcp_wrappers_configuration_files>

Re: Guaranteeing SSH access to specific clients

<1ena6jxoko.ln2@Telcontar.valinor>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10871&group=comp.os.linux.misc#10871

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: robin_listas@es.invalid (Carlos E.R.)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 04:42:25 +0100
Lines: 45
Message-ID: <1ena6jxoko.ln2@Telcontar.valinor>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net QOM1L0farqtY65c4w5zowQRYhiE+VOAYwwqJ9VbShMVX1FZmlt
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:HlMXyJ0trQ2YQjz4Eu9VqO/fsX8=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
Content-Language: es-ES, en-CA
In-Reply-To: <tmu2hq$18b6$1@gioia.aioe.org>
 by: Carlos E.R. - Fri, 9 Dec 2022 03:42 UTC

On 2022-12-09 02:20, Harold Johanssen wrote:
> On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:
>
>> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
>> <noemail@please.net> wrote:

....

> You misunderstood what I wrote. What I meant is the following:
>
> I want to ssh into a specific system that I control, from
> wherever I am in the Internet. Any ssh connections from anybody else into
> that system, wherever they are coming from in the Internet, are
> automatically rejected - it is not that they are rejected when the wrong
> username and password are supplied; rather, their connection requests are
> rejected before the ssh protocol gets started. Can this be done, with the
> constraints that I specified?

No, unless you know how the server is going to know that it is you
calling before hearing your name...

You first answer this, and then we find how the program does that.

Like for example, you know in advance what IP the client is going to have.

Or the client triggers some events before hand. Say, knocking on some
port sequence.

In the end, people do two things:

- make the server listen to a high port instead
- make the server not respond to login/password, but to a public key
challenge.

You may add other things.

--
Cheers, Carlos.

Re: Guaranteeing SSH access to specific clients

<UiidndkhMvwORg_-nZ2dnZfqn_WdnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10876&group=comp.os.linux.misc#10876

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 09 Dec 2022 06:54:11 +0000
Subject: Re: Guaranteeing SSH access to specific clients
Newsgroups: comp.os.linux.misc
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
<1ena6jxoko.ln2@Telcontar.valinor>
From: 26C.Z969@noaada.net (26C.Z969)
Date: Fri, 9 Dec 2022 01:53:42 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <1ena6jxoko.ln2@Telcontar.valinor>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <UiidndkhMvwORg_-nZ2dnZfqn_WdnZ2d@earthlink.com>
Lines: 40
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 68.222.41.46
X-Trace: sv3-yI5qLs/qqU8QMETnKokjoiUhwWU/mu0u4Z2YnbZqThc1FJwQZWJoghmuVVSWA7r1elHyq4PuJOcbcKy!4WdKfsOUx0/MeZtRW9q42PL8LcH6s4webOHgXYBCVaJ2RBElQ3v2ZyDaNNTOlCGPtdyZmkmC8maw!WSr82gVPOi9AmOc4pW4=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: 26C.Z969 - Fri, 9 Dec 2022 06:53 UTC

On 12/8/22 10:42 PM, Carlos E.R. wrote:
> On 2022-12-09 02:20, Harold Johanssen wrote:
>> On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:
>>
>>> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
>>> <noemail@please.net> wrote:
>
> ...
>
>>     You misunderstood what I wrote. What I meant is the following:
>>
>>     I want to ssh into a specific system that I control, from
>> wherever I am in the Internet. Any ssh connections from anybody else into
>> that system, wherever they are coming from in the Internet, are
>> automatically rejected - it is not that they are rejected when the wrong
>> username and password are supplied; rather, their connection requests are
>> rejected before the ssh protocol gets started. Can this be done, with the
>> constraints that I specified?
>
> No, unless you know how the server is going to know that it is you
> calling before hearing your name...

Agreed. SSH - or any other connection system - starts
assuming that all users are equal.

Now there IS the olde-tyme trick called "port knocking"
and there's software to implement that. Those who do not
"knock" correctly don't get in. It's a bit cludgy, but
it IS very secure.

Frankly, decent passwords combined with low tolerance
for brute-force methods like trying 999 times a second
from the same IP address are often Good Enough.

Alas for a big commercial/govt system ... you just can't
DO that. THEY have to bias towards high-volume traffic and
idiot users and thus lose a lot of options when it comes
to rejecting Bad Actors.

Ain't nothin' "perfect" ....

Re: Guaranteeing SSH access to specific clients

<tmuleg$kfj$1@sirius.aeon.icebear.cloud>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10877&group=comp.os.linux.misc#10877

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: h_hucke+spam.news@newsmail.aeon.icebear.org (Henning Hucke)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 06:43:28 -0000 (UTC)
Organization: aeon: think longer than you thought before
Lines: 28
Distribution: world
Message-ID: <tmuleg$kfj$1@sirius.aeon.icebear.cloud>
References: <tmtf02$1ufi$1@gioia.aioe.org> <op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
Reply-To: Henning Hucke <h_hucke+news.reply@newsmail.aeon.icebear.org>
X-Trace: individual.net Ls8DTbPHJBvwX8y4AqwBtwU20y01AB7zoaLQb0bOAO5xkUEsLw
X-Orig-Path: news.aeon.icebear.cloud!news1.aeon.icebear.cloud!.POSTED.romulus.aeon.icebear.cloud!not-for-mail
Cancel-Lock: sha1:MHfC430J0USYGpXuXRiU1S42tDA= sha1:sY5rvIqss9f02cBv9S6yrTP8ZTE=
Injection-Date: Fri, 9 Dec 2022 06:43:28 -0000 (UTC)
Injection-Info: sirius.aeon.icebear.cloud; posting-host="romulus.aeon.icebear.cloud:fd09:afca:b044:1:4ecc:6aff:fecf:5c8f";
logging-data="20979"; mail-complaints-to="abuse+news@aeon.icebear.cloud"
User-Agent: tin/2.4.1-20161224 ("Daill") (UNIX) (Linux/4.9.0-15-amd64 (x86_64))
 by: Henning Hucke - Fri, 9 Dec 2022 06:43 UTC

Harold Johanssen <noemail@please.net> wrote:

Hello Harold,

> [...]
> This would be networking-related question: in a nutshell, if the
> TCP connection on port 22 is coming from me then it is forwarded to the
> ssh daemon; otherwise, it is dropped immediately. The problem is, how
> would the TCP code in my server know that the connection is coming me
> from me, as opposed to anybody else?

strange thinking: Don't communicate ("before the SSH protocol is
started") but recognise me from whichever IP address I might come...

For the case that you still didn't get over to us what you really want
to accomplish you might look into the "tcp wrapper" which is still
linked into the ssh daemon.
But from what I understand about your concern I would recommend a port
knocking mechanism. Hint: Don't use "knockd" for diverse reasons as long
as the system(s) in question already has netfilter tables since this
firewall code is able to implement port knocking totally and very
flexible as a ruleset system.

Best regards,
Henning
--
Honesty is for the most part less profitable than dishonesty.
-- Plato

Re: Guaranteeing SSH access to specific clients

<wwvlengah3w.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10880&group=comp.os.linux.misc#10880

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 09 Dec 2022 12:36:51 +0000
Organization: terraraq NNTP server
Message-ID: <wwvlengah3w.fsf@LkoBDZeT.terraraq.uk>
References: <tmtf02$1ufi$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: mantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="4979"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:nYEVaclCLa6zzZOxFkmIJZappAE=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Fri, 9 Dec 2022 12:36 UTC

Harold Johanssen <noemail@please.net> writes:
> I don't know whether this is reasonable possible, but I thought
> I'd ask anyway, just in case:
>
> Is it possible to guarantee SSH to a specific client, to the
> exclusion of all other clients? In effect, all other connection would be
> immediately rejected, even before the SSH protocol exchange gets going.
> The following requirements must be met:
>
> - The SSH server must be listening on port 22.
> - The target client may connect from different, arbitrary IP
> addresses.
>
> This would be easily possible with tweaked SSH servers and
> clients, but I am not sure it can be done with off-the-shelf ones.

AIUI you want to avoid exposing the SSH session setup implementation to
anything but your chosen clients, for some reason that you’ve not
stated. (Perhaps explaining the motivation would help.)

To do that you need a reasonably secure way to identify your chosen
clients. A VPN could do the job, but now you’re exposing the VPN’s
session setup code to the entire Internet instead of the SSH equivalent.

Unless you have a reason to believe that the VPN is better than SSH, in
whatever way it is you care about, you’ve not gained anything - you’ve
just added complexity to your system.

--
http://www.greenend.org.uk/rjk/

Re: Guaranteeing SSH access to specific clients

<tmvd3i$15cgv$5@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10881&group=comp.os.linux.misc#10881

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 13:27:14 +0000
Organization: A little, after lunch
Lines: 41
Message-ID: <tmvd3i$15cgv$5@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 9 Dec 2022 13:27:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4322b386c0fe3fb3bbea8bafd23b70b0";
logging-data="1225247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FVSAo0uQpdovA6RagcnAZHoDF+5BmggU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:BRjPeD3TKTz+0sduWp7uI7BU0zQ=
Content-Language: en-GB
In-Reply-To: <tmtf02$1ufi$1@gioia.aioe.org>
 by: The Natural Philosop - Fri, 9 Dec 2022 13:27 UTC

On 08/12/2022 19:47, Harold Johanssen wrote:
> I don't know whether this is reasonable possible, but I thought
> I'd ask anyway, just in case:
>
> Is it possible to guarantee SSH to a specific client, to the
> exclusion of all other clients? In effect, all other connection would be
> immediately rejected, even before the SSH protocol exchange gets going.
> The following requirements must be met:
>
> - The SSH server must be listening on port 22.
> - The target client may connect from different, arbitrary IP
> addresses.
>
> This would be easily possible with tweaked SSH servers and
> clients, but I am not sure it can be done with off-the-shelf ones.
think about this for a moment.
To connect, a packet with source port and IP musts connect to
destination port 22 at IP address of server.

In order for this all to work at all, the only variable you can use to
identify 'legal' traffic at the TCP level is the source port.

At that level a simple firewall rule that rejected all connections other
than those from a specific source port would do what you want.

How to ensure your application only used that port is somewhat trickier,
especially if its behind NAṪ

So its possible, but non trivial

--
“Puritanism: The haunting fear that someone, somewhere, may be happy.”

H.L. Mencken, A Mencken Chrestomathy

Re: Guaranteeing SSH access to specific clients

<tmvd8a$15cgv$6@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10882&group=comp.os.linux.misc#10882

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 13:29:46 +0000
Organization: A little, after lunch
Lines: 70
Message-ID: <tmvd8a$15cgv$6@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Dec 2022 13:29:46 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4322b386c0fe3fb3bbea8bafd23b70b0";
logging-data="1225247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pBAUPDpoxEP+2S/GtpiSaAbjyDyuACZg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:aNcmnLb+QK3NkFemj1uWHDOWHRU=
Content-Language: en-GB
In-Reply-To: <tmu2hq$18b6$1@gioia.aioe.org>
 by: The Natural Philosop - Fri, 9 Dec 2022 13:29 UTC

On 09/12/2022 01:20, Harold Johanssen wrote:
> On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:
>
>> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
>> <noemail@please.net> wrote:
>>
>>> I don't know whether this is reasonable possible, but I thought
>>> I'd ask anyway, just in case:
>>>
>>> Is it possible to guarantee SSH to a specific client, to the
>>> exclusion of all other clients? In effect, all other connection would
>>> be immediately rejected, even before the SSH protocol exchange gets
>>> going. The following requirements must be met:
>>>
>>> - The SSH server must be listening on port 22.
>>> - The target client may connect from different, arbitrary IP
>>> addresses.
>>>
>>> This would be easily possible with tweaked SSH servers and
>>> clients, but I am not sure it can be done with off-the-shelf ones.
>>
>> Excluding all other clients would go against the fact that linux is a
>> multi-user system, so it's not a standard feature.
>>
>> killing the sshd server does not kill the working ssh connection(s), so
>> you could have a script run on login via ssh that kills the sshd server,
>> but you'd have to also figure out how to restart it after that
>> connection ends (intentionally or not).
>>
>> Why do you want to do this? There's probably a better way to lock things
>> when needed.
>>
>> Regards, Dave Hodgins
>
> You misunderstood what I wrote. What I meant is the following:
>
> I want to ssh into a specific system that I control, from
> wherever I am in the Internet. Any ssh connections from anybody else into
> that system, wherever they are coming from in the Internet, are
> automatically rejected - it is not that they are rejected when the wrong
> username and password are supplied; rather, their connection requests are
> rejected before the ssh protocol gets started. Can this be done, with the
> constraints that I specified?

I use a random sshd high port for this.
Ok if someone port scans they might find it. But script kiddies are not
so good as that.

>
> This would be networking-related question: in a nutshell, if the
> TCP connection on port 22 is coming from me then it is forwarded to the
> ssh daemon; otherwise, it is dropped immediately. The problem is, how
> would the TCP code in my server know that the connection is coming me
> from me, as opposed to anybody else?
>
As I said, either because it isn't on 22 at all, or because you ate
using an identifiable source port

--
"The most difficult subjects can be explained to the most slow witted
man if he has not formed any idea of them already; but the simplest
thing cannot be made clear to the most intelligent man if he is firmly
persuaded that he knows already, without a shadow of doubt, what is laid
before him."

- Leo Tolstoy

Re: Guaranteeing SSH access to specific clients

<slrntp6fi4.jv5.trepidation@vps.jonz.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10883&group=comp.os.linux.misc#10883

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: trepidation@example.net (Allodoxaphobia)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: 9 Dec 2022 13:55:36 GMT
Lines: 46
Message-ID: <slrntp6fi4.jv5.trepidation@vps.jonz.net>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
X-Trace: individual.net vfTMeCSjItSAxQmnfWUa8QfRAMhcEJx758pN7lLvXAViArVzH4
Cancel-Lock: sha1:EGpx1Py90G8MxldrHONK9tWF9dg=
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Allodoxaphobia - Fri, 9 Dec 2022 13:55 UTC

On Fri, 9 Dec 2022 01:20:58 -0000 (UTC), Harold Johanssen wrote:
> On Thu, 08 Dec 2022 16:31:45 -0500, David W. Hodgins wrote:
>> On Thu, 08 Dec 2022 14:47:14 -0500, Harold Johanssen
>> <noemail@please.net> wrote:
>>
>>> I don't know whether this is reasonable possible, but I thought
>>> I'd ask anyway, just in case:
>>>
>>> Is it possible to guarantee SSH to a specific client, to the
>>> exclusion of all other clients? In effect, all other connection would
>>> be immediately rejected, even before the SSH protocol exchange gets
>>> going. The following requirements must be met:
>>>
>>> - The SSH server must be listening on port 22.
>>> - The target client may connect from different, arbitrary IP
>>> addresses.
>>>
>>> This would be easily possible with tweaked SSH servers and
>>> clients, but I am not sure it can be done with off-the-shelf ones.
>>
>> Excluding all other clients would go against the fact that linux is a
>> multi-user system, so it's not a standard feature.
>>
>> killing the sshd server does not kill the working ssh connection(s), so
>> you could have a script run on login via ssh that kills the sshd server,
>> but you'd have to also figure out how to restart it after that
>> connection ends (intentionally or not).
>>
>> Why do you want to do this? There's probably a better way to lock things
>> when needed.
>>
>> Regards, Dave Hodgins
>
> You misunderstood what I wrote. What I meant is the following:
>
> I want to ssh into a specific system that I control, from
> wherever I am in the Internet. Any ssh connections from anybody else into
> that system, wherever they are coming from in the Internet, are
> automatically rejected - it is not that they are rejected when the wrong
> username and password are supplied; rather, their connection requests are
> rejected before the ssh protocol gets started. Can this be done, with the
> constraints that I specified?

For crying out loud!
Simply use public-private keys _only_
between the one client (you) and the ssh server.

Re: Guaranteeing SSH access to specific clients

<tmvfgb$14g2u$6@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10884&group=comp.os.linux.misc#10884

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Pancho.Jones@proton.me (Pancho)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 14:08:11 +0000
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <tmvfgb$14g2u$6@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net> <tmu2hq$18b6$1@gioia.aioe.org>
<slrntp6fi4.jv5.trepidation@vps.jonz.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Dec 2022 14:08:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="e193d8e4bddece6610c1733634f896e4";
logging-data="1196126"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HF7PbKqYZhwcDWEF2SdYZZOz4g6ERHEo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.0
Cancel-Lock: sha1:JCNOTxsu/5ixPEf2O5Ihuk9lBDs=
In-Reply-To: <slrntp6fi4.jv5.trepidation@vps.jonz.net>
Content-Language: en-GB
 by: Pancho - Fri, 9 Dec 2022 14:08 UTC

On 09/12/2022 13:55, Allodoxaphobia wrote:

>> I want to ssh into a specific system that I control, from
>> wherever I am in the Internet. Any ssh connections from anybody else into
>> that system, wherever they are coming from in the Internet, are
>> automatically rejected - it is not that they are rejected when the wrong
>> username and password are supplied; rather, their connection requests are
>> rejected before the ssh protocol gets started. Can this be done, with the
>> constraints that I specified?
>
> For crying out loud!
> Simply use public-private keys _only_
> between the one client (you) and the ssh server.

Yeah, I don't think I understand the question, because I just use
..ssh/authorised_keys. It seemed registering the specific client public
key in .ssh/authorised_keys and turning off ssh password authentication
would do the trick.

Re: Guaranteeing SSH access to specific clients

<tmvhru$ccf$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10886&group=comp.os.linux.misc#10886

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!fs4vz7lwhQCwq5L3H1slGg.user.46.165.242.75.POSTED!not-for-mail
From: noemail@please.net (Harold Johanssen)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 14:48:30 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tmvhru$ccf$1@gioia.aioe.org>
References: <tmtf02$1ufi$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="12687"; posting-host="fs4vz7lwhQCwq5L3H1slGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Harold Johanssen - Fri, 9 Dec 2022 14:48 UTC

On Thu, 8 Dec 2022 19:47:14 -0000 (UTC), Harold Johanssen wrote:

> I don't know whether this is reasonable possible, but I thought I'd ask
> anyway, just in case:
>
> Is it possible to guarantee SSH to a specific client, to the
> exclusion of all other clients? In effect, all other connection would be
> immediately rejected, even before the SSH protocol exchange gets going.
> The following requirements must be met:
>
> - The SSH server must be listening on port 22.
> - The target client may connect from different, arbitrary IP
> addresses.
>
> This would be easily possible with tweaked SSH servers and
> clients, but I am not sure it can be done with off-the-shelf ones.

Thank everybody for your suggestion. Here's what I am going to do:

Since I am talking about a particular Linux SSH server that I
fully control, and a particular Linux SSH client that I also fully
control, I am going to make use of the SSH identification string. Since
this string contemplates an optional field where one can put anything
(with the constraints mentioned in the relevant RFC) I will use the
contents of that string to filter out incoming connections.

Initially I will use some arbitrary, fixed string - the changes
to the SSH client and server codes to support this are trivial. Later on
I could use a OTP-like scheme, which would not be much more difficult to
pull off. Either way, my server will reject pests before the SSH protocol
exchange gets going (which is elaborate and computationally intensive)
and my client will still work with standard SSH servers. I'll have to
maintain that code, but that will be a nice entertainment.

Re: Guaranteeing SSH access to specific clients

<tmvl0f$16evk$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10887&group=comp.os.linux.misc#10887

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tauno.voipio@notused.fi.invalid (Tauno Voipio)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 17:42:05 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <tmvl0f$16evk$1@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Dec 2022 15:42:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="0e0bf56ee4007091401782e2f013d825";
logging-data="1260532"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mGlvLQSKBi9Ub26xjHz0/Eqo1iNsLfaA="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.5.1
Cancel-Lock: sha1:pyVbdtNRAXuw1/e21R0iGhwYEEE=
Content-Language: en-US
In-Reply-To: <tmvhru$ccf$1@gioia.aioe.org>
 by: Tauno Voipio - Fri, 9 Dec 2022 15:42 UTC

On 9.12.2022 16.48, Harold Johanssen wrote:
> On Thu, 8 Dec 2022 19:47:14 -0000 (UTC), Harold Johanssen wrote:
>
>> I don't know whether this is reasonable possible, but I thought I'd ask
>> anyway, just in case:
>>
>> Is it possible to guarantee SSH to a specific client, to the
>> exclusion of all other clients? In effect, all other connection would be
>> immediately rejected, even before the SSH protocol exchange gets going.
>> The following requirements must be met:
>>
>> - The SSH server must be listening on port 22.
>> - The target client may connect from different, arbitrary IP
>> addresses.
>>
>> This would be easily possible with tweaked SSH servers and
>> clients, but I am not sure it can be done with off-the-shelf ones.
>
> Thank everybody for your suggestion. Here's what I am going to do:
>
> Since I am talking about a particular Linux SSH server that I
> fully control, and a particular Linux SSH client that I also fully
> control, I am going to make use of the SSH identification string. Since
> this string contemplates an optional field where one can put anything
> (with the constraints mentioned in the relevant RFC) I will use the
> contents of that string to filter out incoming connections.
>
> Initially I will use some arbitrary, fixed string - the changes
> to the SSH client and server codes to support this are trivial. Later on
> I could use a OTP-like scheme, which would not be much more difficult to
> pull off. Either way, my server will reject pests before the SSH protocol
> exchange gets going (which is elaborate and computationally intensive)
> and my client will still work with standard SSH servers. I'll have to
> maintain that code, but that will be a nice entertainment.

There is a such mechanism already in SSH. Google for
'passswordless ssh login'. The generated cryptographic
keys are far more secure than an invented string.

--

-TV

Re: Guaranteeing SSH access to specific clients

<tmvrn1$1890b$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10888&group=comp.os.linux.misc#10888

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 17:36:33 +0000
Organization: A little, after lunch
Lines: 18
Message-ID: <tmvrn1$1890b$1@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>
<tmvl0f$16evk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 9 Dec 2022 17:36:33 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4322b386c0fe3fb3bbea8bafd23b70b0";
logging-data="1319947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++s0Fxcg3KuAgYtWxttp0qOvfwiZiggls="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:/DOy5Sb2fUNqvM3zqfmH5sP9QHw=
In-Reply-To: <tmvl0f$16evk$1@dont-email.me>
Content-Language: en-GB
 by: The Natural Philosop - Fri, 9 Dec 2022 17:36 UTC

On 09/12/2022 15:42, Tauno Voipio wrote:
>
> There is a such mechanism already in SSH. Google for
> 'passswordless ssh login'. The generated cryptographic
> keys are far more secure than an invented string.

This is the best way except it does allow for a lot of random traffic
hitting port 22 and trying to find a way in.
Using obscure ports helps with this

--
“It is hard to imagine a more stupid decision or more dangerous way of
making decisions than by putting those decisions in the hands of people
who pay no price for being wrong.”

Thomas Sowell

Re: Guaranteeing SSH access to specific clients

<87mt7wsc8b.fsf@usenet.ankman.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10889&group=comp.os.linux.misc#10889

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ank@spamfence.net (Andreas Kohlbach)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 09 Dec 2022 12:44:52 -0500
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87mt7wsc8b.fsf@usenet.ankman.de>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net>
<mMicnffNIKpVMQ_-nZ2dnZfqnPadnZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e781e4e81e10332bbfefa3dad878b889";
logging-data="1322045"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v0OrxflEILyYA45nPEk+x"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:XoGmlqVljfQpSYw5hx0dj1E5OHo=
sha1:M7xANPDpiw7GEu7CShuJrqJ85/Q=
X-No-Archive: Yes
 by: Andreas Kohlbach - Fri, 9 Dec 2022 17:44 UTC

On Fri, 09 Dec 2022 03:34:32 +0000, Robert Heller wrote:
>
> If the accepted clients have specific, known IP addresses, then if the server
> has a firewall (eg iptables, firewalld, etc.), then firewall rules could be
> set up to "reject" (or drop) port 22 packets from non-accepted IP addresses.
> No changes to sshd or special settings in /etc/ssh/*config would be needed.

SSH has options itself to deal with traffic.

As long as a server can deal with these things I refrained from using a
package filter.

Example SMB. I set up

bind interfaces only = Yes

and

interfaces = 127.0.0.0/8 eth0

to only allow localhost and what comes over Ethernet (my other computer).
--
Andreas

Re: Guaranteeing SSH access to specific clients

<tmvsl4$1890b$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10890&group=comp.os.linux.misc#10890

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 17:52:36 +0000
Organization: A little, after lunch
Lines: 36
Message-ID: <tmvsl4$1890b$2@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org>
<op.1wvne71ia3w0dxdave@hodgins.homeip.net>
<mMicnffNIKpVMQ_-nZ2dnZfqnPadnZ2d@giganews.com>
<87mt7wsc8b.fsf@usenet.ankman.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Dec 2022 17:52:36 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4322b386c0fe3fb3bbea8bafd23b70b0";
logging-data="1319947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xDLijlB61Neb8uDe9Pbpvmy5APEpzAP8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:y4dyjuEts0jUF18b30woouJsksk=
In-Reply-To: <87mt7wsc8b.fsf@usenet.ankman.de>
Content-Language: en-GB
 by: The Natural Philosop - Fri, 9 Dec 2022 17:52 UTC

On 09/12/2022 17:44, Andreas Kohlbach wrote:
> On Fri, 09 Dec 2022 03:34:32 +0000, Robert Heller wrote:
>>
>> If the accepted clients have specific, known IP addresses, then if the server
>> has a firewall (eg iptables, firewalld, etc.), then firewall rules could be
>> set up to "reject" (or drop) port 22 packets from non-accepted IP addresses.
>> No changes to sshd or special settings in /etc/ssh/*config would be needed.
>
> SSH has options itself to deal with traffic.
>
> As long as a server can deal with these things I refrained from using a
> package filter.
>
> Example SMB. I set up
>
> bind interfaces only = Yes
>
> and
>
> interfaces = 127.0.0.0/8 eth0
>
> to only allow localhost and what comes over Ethernet (my other computer).

Won't solve OPs problem since the IP address of the source is neither
constant nor known in advance.

--
Socialism is the philosophy of failure, the creed of ignorance and the
gospel of envy.

Its inherent virtue is the equal sharing of misery.

Winston Churchill

Re: Guaranteeing SSH access to specific clients

<QqSdnauOjKhhEA7-nZ2dnZfqn_qdnZ2d@giganews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10891&group=comp.os.linux.misc#10891

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 09 Dec 2022 19:35:23 +0000
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.15)
Subject: Re: Guaranteeing SSH access to specific clients
In-Reply-To: <tmvrn1$1890b$1@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>?
<tmvl0f$16evk$1@dont-email.me> <tmvrn1$1890b$1@dont-email.me>
Newsgroups: comp.os.linux.misc
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <QqSdnauOjKhhEA7-nZ2dnZfqn_qdnZ2d@giganews.com>
Date: Fri, 09 Dec 2022 19:35:24 +0000
Lines: 25
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-WbH1hkopIXeymnQ+NpsfTu64zGK9BTVeXVQow23P1mP9wSmUKGUXOC0blGlPy2mMpUXxSjuqmDOqagr!psDrnYWw5AK14qRJ5pYxmlSMyMBqRjuw5i/wnKlvYJ0wNu+PnXqgUxGutlnvTGPtZiRYdkOf6reS!UJc=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Robert Heller - Fri, 9 Dec 2022 19:35 UTC

At Fri, 9 Dec 2022 17:36:33 +0000 The Natural Philosopher <tnp@invalid.invalid> wrote:

>
> On 09/12/2022 15:42, Tauno Voipio wrote:
> >
> > There is a such mechanism already in SSH. Google for
> > 'passswordless ssh login'. The generated cryptographic
> > keys are far more secure than an invented string.
>
> This is the best way except it does allow for a lot of random traffic
> hitting port 22 and trying to find a way in.
> Using obscure ports helps with this

Not really, but disabling passsword login greatly cuts down the brute force
attempts.

>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: Guaranteeing SSH access to specific clients

<tn0bbn$btf$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10892&group=comp.os.linux.misc#10892

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!fs4vz7lwhQCwq5L3H1slGg.user.46.165.242.75.POSTED!not-for-mail
From: noemail@please.net (Harold Johanssen)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Fri, 9 Dec 2022 22:03:35 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tn0bbn$btf$1@gioia.aioe.org>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>
<tmvl0f$16evk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="12207"; posting-host="fs4vz7lwhQCwq5L3H1slGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Harold Johanssen - Fri, 9 Dec 2022 22:03 UTC

On Fri, 9 Dec 2022 17:42:05 +0200, Tauno Voipio wrote:

> On 9.12.2022 16.48, Harold Johanssen wrote:
>> On Thu, 8 Dec 2022 19:47:14 -0000 (UTC), Harold Johanssen wrote:
>>
>>> I don't know whether this is reasonable possible, but I thought I'd
>>> ask anyway, just in case:
>>>
>>> Is it possible to guarantee SSH to a specific client, to the
>>> exclusion of all other clients? In effect, all other connection would
>>> be immediately rejected, even before the SSH protocol exchange gets
>>> going. The following requirements must be met:
>>>
>>> - The SSH server must be listening on port 22.
>>> - The target client may connect from different, arbitrary IP
>>> addresses.
>>>
>>> This would be easily possible with tweaked SSH servers and
>>> clients, but I am not sure it can be done with off-the-shelf ones.
>>
>> Thank everybody for your suggestion. Here's what I am going to do:
>>
>> Since I am talking about a particular Linux SSH server that I
>> fully control, and a particular Linux SSH client that I also fully
>> control, I am going to make use of the SSH identification string. Since
>> this string contemplates an optional field where one can put anything
>> (with the constraints mentioned in the relevant RFC) I will use the
>> contents of that string to filter out incoming connections.
>>
>> Initially I will use some arbitrary, fixed string - the changes
>> to the SSH client and server codes to support this are trivial. Later
>> on I could use a OTP-like scheme, which would not be much more
>> difficult to pull off. Either way, my server will reject pests before
>> the SSH protocol exchange gets going (which is elaborate and
>> computationally intensive) and my client will still work with standard
>> SSH servers. I'll have to maintain that code, but that will be a nice
>> entertainment.
>
> There is a such mechanism already in SSH. Google for 'passswordless ssh
> login'. The generated cryptographic keys are far more secure than an
> invented string.

That does not prevent the computationally expensive secure
channel establishment exchanges from taking place, for the authentication
mechanisms exchange phase happens after the secure channel has been
created.

Notice what I want to do does not replace the authentication
mechanisms already in place in the ssh protocol - I am just aiming to
slam the door on intruders as early in the connection as possible. Once a
connection is accepted by virtue of the mechanism described above, the
rest is pure ssh.

Re: Guaranteeing SSH access to specific clients

<tn1kup$1kimo$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10896&group=comp.os.linux.misc#10896

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Sat, 10 Dec 2022 09:53:29 +0000
Organization: A little, after lunch
Lines: 26
Message-ID: <tn1kup$1kimo$1@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>
<tmvl0f$16evk$1@dont-email.me> <tmvrn1$1890b$1@dont-email.me>
<QqSdnauOjKhhEA7-nZ2dnZfqn_qdnZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 10 Dec 2022 09:53:29 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="d27343656711bffa233104010e5f0d85";
logging-data="1723096"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Van2PZGyWxAfs2/yLEh51nINVfGIL2Vs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:9zsnTu6ynd4IdNNT6bKNEzQEKb4=
Content-Language: en-GB
In-Reply-To: <QqSdnauOjKhhEA7-nZ2dnZfqn_qdnZ2d@giganews.com>
 by: The Natural Philosop - Sat, 10 Dec 2022 09:53 UTC

On 09/12/2022 19:35, Robert Heller wrote:
> At Fri, 9 Dec 2022 17:36:33 +0000 The Natural Philosopher <tnp@invalid.invalid> wrote:
>
>>
>> On 09/12/2022 15:42, Tauno Voipio wrote:
>>>
>>> There is a such mechanism already in SSH. Google for
>>> 'passswordless ssh login'. The generated cryptographic
>>> keys are far more secure than an invented string.
>>
>> This is the best way except it does allow for a lot of random traffic
>> hitting port 22 and trying to find a way in.
>> Using obscure ports helps with this
>
> Not really, but disabling passsword login greatly cuts down the brute force
> attempts.
>
Does it? Cant say I noticed.

Problem is you need password to get in to set up the passwordless logins¡!

--
In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

- George Orwell

Re: Guaranteeing SSH access to specific clients

<tn1l40$1kimo$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=10897&group=comp.os.linux.misc#10897

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Guaranteeing SSH access to specific clients
Date: Sat, 10 Dec 2022 09:56:16 +0000
Organization: A little, after lunch
Lines: 19
Message-ID: <tn1l40$1kimo$2@dont-email.me>
References: <tmtf02$1ufi$1@gioia.aioe.org> <tmvhru$ccf$1@gioia.aioe.org>
<tmvl0f$16evk$1@dont-email.me> <tn0bbn$btf$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Dec 2022 09:56:16 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="d27343656711bffa233104010e5f0d85";
logging-data="1723096"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zRpUupYq8CHhIWVh+qsTkkiUsoYOjlig="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:XUanChwDcq64ZakqvS5XEnq8j2I=
Content-Language: en-GB
In-Reply-To: <tn0bbn$btf$1@gioia.aioe.org>
 by: The Natural Philosop - Sat, 10 Dec 2022 09:56 UTC

On 09/12/2022 22:03, Harold Johanssen wrote:
> Notice what I want to do does not replace the authentication
> mechanisms already in place in the ssh protocol - I am just aiming to
> slam the door on intruders as early in the connection as possible. Once a
> connection is accepted by virtue of the mechanism described above, the
> rest is pure ssh.

Then the only criteria available are the source port and IP address.
So its either port knocking to open a hole, or its using a guaranteed
source port, since the source IP address cannot be guaranteed.

There are no other options

--
In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

- George Orwell

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor