Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Whenever people agree with me, I always think I must be wrong. -- Oscar Wilde


computers / comp.os.linux.networking / Re: Connecting to an SSH server from the external world

SubjectAuthor
* Connecting to an SSH server from the external worldJohn Smith
+* Re: Connecting to an SSH server from the external worldWilliam Unruh
|`* Re: Connecting to an SSH server from the external worldJohn Smith
| +* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |`- Re: Connecting to an SSH server from the external worldJohn Smith
| +* Re: Connecting to an SSH server from the external worldWilliam Unruh
| |`- Re: Connecting to an SSH server from the external worldGrant Taylor
| +- Re: Connecting to an SSH server from the external worldRichard Kettlewell
| `- Re: Connecting to an SSH server from the external worldpk
+* Re: Connecting to an SSH server from the external worldGrant Taylor
|`* Re: Connecting to an SSH server from the external worldJohn Smith
| +- Re: Connecting to an SSH server from the external worldMarc Haber
| `- Re: Connecting to an SSH server from the external worldGrant Taylor
+* Re: Connecting to an SSH server from the external worldHenning Hucke
|`* Re: Connecting to an SSH server from the external worldD. Stussy
| +* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |`* Re: Connecting to an SSH server from the external worldGrant Taylor
| | `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |  `* Re: Connecting to an SSH server from the external worldGrant Taylor
| |   `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |    `* Re: Connecting to an SSH server from the external worldGrant Taylor
| |     `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |      `* Re: Connecting to an SSH server from the external worldGrant Taylor
| |       +- Re: Connecting to an SSH server from the external worldDavid W. Hodgins
| |       `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |        `* Re: Connecting to an SSH server from the external worldGrant Taylor
| |         `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |          +* Re: Connecting to an SSH server from the external worldGrant Taylor
| |          |`* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |          | `- Re: Connecting to an SSH server from the external worldGrant Taylor
| |          `* Re: Connecting to an SSH server from the external worldWilliam Unruh
| |           `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |            `* Re: Connecting to an SSH server from the external worldGrant Taylor
| |             `* Re: Connecting to an SSH server from the external worldWilliam Unruh
| |              `- Re: Connecting to an SSH server from the external worldWilliam Unruh
| `- Re: Connecting to an SSH server from the external worldGrant Taylor
+- Re: Connecting to an SSH server from the external worldRichard Kettlewell
+* Re: Connecting to an SSH server from the external worldGiovanni
|`* Re: Connecting to an SSH server from the external worldMarc Haber
| +* Re: Connecting to an SSH server from the external worldGiovanni
| |+* Re: Connecting to an SSH server from the external worldWilliam Unruh
| ||+* Re: Connecting to an SSH server from the external worldRoger Blake
| |||`* Re: Connecting to an SSH server from the external worldJohann Beretta
| ||| `* Re: Connecting to an SSH server from the external worldPascal Hambourg
| |||  `* Re: Connecting to an SSH server from the external worldMarc Haber
| |||   `- Re: Connecting to an SSH server from the external worldJohann Beretta
| ||+* Re: Connecting to an SSH server from the external worldGrant Taylor
| |||`* Re: Connecting to an SSH server from the external worldWilliam Unruh
| ||| `* Re: Connecting to an SSH server from the external worldMarc Haber
| |||  `- Re: Connecting to an SSH server from the external worldWilliam Unruh
| ||`- Re: Connecting to an SSH server from the external worldMarc Haber
| |`- Re: Connecting to an SSH server from the external worldMarc Haber
| `* Re: Connecting to an SSH server from the external worldGrant Taylor
|  `- Re: Connecting to an SSH server from the external worldMarc Haber
`* Re: Connecting to an SSH server from the external worldCarlos E.R.
 `- Re: Connecting to an SSH server from the external worldGrant Taylor

Pages:123
Re: Connecting to an SSH server from the external world

<60c768fa$0$27429$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=187&group=comp.os.linux.networking#187

  copy link   Newsgroups: comp.os.linux.networking
X-Received: by 2002:a1c:e0c1:: with SMTP id x184mr11404856wmg.84.1623681274194;
Mon, 14 Jun 2021 07:34:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!proxad.net!feeder1-2.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp1-2.free.fr!not-for-mail
Subject: Re: Connecting to an SSH server from the external world
Newsgroups: comp.os.linux.networking
References: <s8rnfh$qp2$1@gioia.aioe.org>
<slrnsb3ql0.9a0.h_hucke+spam.news@romulus.aeon.icebear.cloud>
<s8v14o$c2g$1@server.snarked.org> <60b36e50$0$21617$426a74cc@news.free.fr>
<s94ebe$1os$4@tncsrv09.home.tnetconsulting.net>
<60b66393$0$32499$426a74cc@news.free.fr>
<s966gd$gnc$1@tncsrv09.home.tnetconsulting.net>
<60b8b3fd$0$32507$426a74cc@news.free.fr>
<s9cboj$13j$1@tncsrv09.home.tnetconsulting.net>
<60bbb36f$0$27424$426a74cc@news.free.fr>
<s9gui7$773$1@tncsrv09.home.tnetconsulting.net>
<60c47b5d$0$3709$426a34cc@news.free.fr>
<sa2pu8$1ve$1@tncsrv09.home.tnetconsulting.net>
<60c5f22b$0$27428$426a34cc@news.free.fr> <sa5gqs$rfr$1@dont-email.me>
From: pas...@plouf.fr.eu.org (Pascal Hambourg)
Date: Mon, 14 Jun 2021 16:34:33 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
MIME-Version: 1.0
In-Reply-To: <sa5gqs$rfr$1@dont-email.me>
Lines: 36
Message-ID: <60c768fa$0$27429$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 14 Jun 2021 16:34:34 CEST
NNTP-Posting-Host: 213.41.155.166
X-Trace: 1623681274 news-2.free.fr 27429 213.41.155.166:38224
X-Complaints-To: abuse@proxad.net
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Received-Bytes: 3306
 by: Pascal Hambourg - Mon, 14 Jun 2021 14:34 UTC

Le 13/06/2021 à 19:55, William Unruh a écrit :
> On 2021-06-13, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote:
>> Le 12/06/2021 à 19:12, Grant Taylor a écrit :
>>> On 6/12/21 3:16 AM, Pascal Hambourg wrote:
>>>> Granularity is one single address.
>>>
>>> Okay.
>>>
>>> The next (snarky) question is how many of those fine granular single
>>> addresses do you want to support.  Supporting a few networks of that and
>>> lumping the rest could be done.
>>
>> Supporting a few networks only has been out of the scope from the
>> beginning of this thread. The OP wrote "no matter where the laptop may
>> be", which means from ANY assigned public unicast address.
>
> Except that each of those does not need individual attention. You can
> just lump them together.

Of course it does. You don't want to allow your "neigbour" which is
eavesdropping on your traffic to replay the port knocking sequence you
just sent.

> Of course that opens you up to ssh attacks so
> you need something else (eg port knocking)

This is exactly what we are discussing in that part of the thread : port
knocking implemented with iptables as someone suggested.

>> Scalability makes its tecnhically possible - or not. Even the simplest
>> port knocking algorithm (one packet) requires at least two iptables
>> rules per address, so it accounts for about 8 billion rules. Even if
> Why? you can have one rule for a range of addresses.

No, you need different one rule per single address to prevent port
knocking replay.

Re: Connecting to an SSH server from the external world

<sa83sk$rlp$1@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=188&group=comp.os.linux.networking#188

  copy link   Newsgroups: comp.os.linux.networking
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.alpha.home.tnetconsulting.net!not-for-mail
From: gtay...@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.os.linux.networking
Subject: Re: Connecting to an SSH server from the external world
Date: Mon, 14 Jun 2021 11:32:54 -0600
Organization: TNet Consulting
Message-ID: <sa83sk$rlp$1@tncsrv09.home.tnetconsulting.net>
References: <s8rnfh$qp2$1@gioia.aioe.org>
<slrnsb3ql0.9a0.h_hucke+spam.news@romulus.aeon.icebear.cloud>
<s8v14o$c2g$1@server.snarked.org> <60b36e50$0$21617$426a74cc@news.free.fr>
<s94ebe$1os$4@tncsrv09.home.tnetconsulting.net>
<60b66393$0$32499$426a74cc@news.free.fr>
<s966gd$gnc$1@tncsrv09.home.tnetconsulting.net>
<60b8b3fd$0$32507$426a74cc@news.free.fr>
<s9cboj$13j$1@tncsrv09.home.tnetconsulting.net>
<60bbb36f$0$27424$426a74cc@news.free.fr>
<s9gui7$773$1@tncsrv09.home.tnetconsulting.net>
<60c47b5d$0$3709$426a34cc@news.free.fr>
<sa2pu8$1ve$1@tncsrv09.home.tnetconsulting.net>
<60c5f22b$0$27428$426a34cc@news.free.fr>
<sa5cf6$bo6$1@tncsrv09.home.tnetconsulting.net>
<60c767ae$0$6183$426a74cc@news.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 14 Jun 2021 17:33:08 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251";
logging-data="28345"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
In-Reply-To: <60c767ae$0$6183$426a74cc@news.free.fr>
Content-Language: en-US
 by: Grant Taylor - Mon, 14 Jun 2021 17:32 UTC

On 6/14/21 8:29 AM, Pascal Hambourg wrote:
> You are right. I have always used the recent match in pairs and did not
> think that one rule could be shared.

;-)

> You are right again, only 4 billion rules (one per address). A bit less
> if you remove the reserved ranges (multicast, private...) but that's
> still the order of magnitude.

I largely agree. (I'll reply to your reply to William in more details.)

> In an attempt to gather real figures, I did some tests on Debian 10
> amd64, with 8 GiB memory. iptables-nft-restore (nftables compatibility
> flavour) failed after adding ~300k rules, iptables-legacy-restore
> (original flavour) failed after adding ~1,3M rules.

Please elaborate on how you did your testing.

You say iptables-*-restore, which tells me that you were trying to read
rules and restore them as one operation. (As opposed to iptables which
is non-atomic and does a read / modify / write cycle per rule added.)

Did you create a file that was the rule set that iptables-*-restore was
reading in?

What did a rule (which I assume was the same and repeated for each
different IP) look like?

I wonder if the problem that you were running into was a problem with
the number of rules and or an issue with a part of the rule, e.g.
scalability of the recent match extension.

> The used memory was much lower than the available memory and I got
> the same results after limiting the usable memory to 2 GiB, so these
> limits do not seem memory-related.

ACK

I am both surprised and not surprised at the same time. I know that
some memory allocation is a percentage of overall system memory. Though
that may be based on a percentage of an upper bound.

> So it seems that iptables cannot hande more than 1,3M rules, which
> is very far from 4G.

I'll agree that the kernel you were booting couldn't scale anywhere near
the 4 B rules. But I wouldn't say that it's not possible based off of
one kernel. But your tests do give information where there previously
was none. (At least in this discussion.)

> I also estimated by comparison of the output of free that each rule
> consumes ~500 bytes (iptables-legacy) to ~670 bytes (iptables-nft), much
> more than I expected. So even if iptables could handle 4G rules, they
> would consume at least 2 TB of memory.

I think that 2 TB of memory is within the realm of possibility if
someone wanted to do it. Though I doubt they would do so for a firewall.

--
Grant. . . .
unix || die

Re: Connecting to an SSH server from the external world

<sa848e$63j$1@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=189&group=comp.os.linux.networking#189

  copy link   Newsgroups: comp.os.linux.networking
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.alpha.home.tnetconsulting.net!not-for-mail
From: gtay...@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.os.linux.networking
Subject: Re: Connecting to an SSH server from the external world
Date: Mon, 14 Jun 2021 11:39:12 -0600
Organization: TNet Consulting
Message-ID: <sa848e$63j$1@tncsrv09.home.tnetconsulting.net>
References: <s8rnfh$qp2$1@gioia.aioe.org>
<slrnsb3ql0.9a0.h_hucke+spam.news@romulus.aeon.icebear.cloud>
<s8v14o$c2g$1@server.snarked.org> <60b36e50$0$21617$426a74cc@news.free.fr>
<s94ebe$1os$4@tncsrv09.home.tnetconsulting.net>
<60b66393$0$32499$426a74cc@news.free.fr>
<s966gd$gnc$1@tncsrv09.home.tnetconsulting.net>
<60b8b3fd$0$32507$426a74cc@news.free.fr>
<s9cboj$13j$1@tncsrv09.home.tnetconsulting.net>
<60bbb36f$0$27424$426a74cc@news.free.fr>
<s9gui7$773$1@tncsrv09.home.tnetconsulting.net>
<60c47b5d$0$3709$426a34cc@news.free.fr>
<sa2pu8$1ve$1@tncsrv09.home.tnetconsulting.net>
<60c5f22b$0$27428$426a34cc@news.free.fr> <sa5gqs$rfr$1@dont-email.me>
<60c768fa$0$27429$426a74cc@news.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 14 Jun 2021 17:39:26 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251";
logging-data="6259"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
In-Reply-To: <60c768fa$0$27429$426a74cc@news.free.fr>
Content-Language: en-US
 by: Grant Taylor - Mon, 14 Jun 2021 17:39 UTC

On 6/14/21 8:34 AM, Pascal Hambourg wrote:
> Of course it does.

I agree with William. I don't believe that each individual source IP
needs individual port knock sequences.

> You don't want to allow your "neigbour" which is eavesdropping on
> your traffic to replay the port knocking sequence you just sent.

I don't care about my neighbor. I care about random malware not being
able to get to my SSH daemon.

There's also the fact that my neighbor - who's not on my LAN - is going
to have trouble eavesdropping on the port knock sequence.

> This is exactly what we are discussing in that part of the thread : port
> knocking implemented with iptables as someone suggested.

Which is entirely possible to do, especially with loose granularity.
I've done it multiple times.

> No, you need different one rule per single address to prevent port
> knocking replay.

Not if you don't care about knock reply.

It really depends on what you're trying to use port knocking to protect
against. If you're trying to simply reduce noise from SSH brute force
attempts, then you very likely don't care about knock reply protection.
If you're trying to protect against someone else in the coffee shop
replaying and attacking you personally, well, a port knock sequence no
matter how complex, probably won't suffice and you need a different
solution.

--
Grant. . . .
unix || die

Re: Connecting to an SSH server from the external world

<sa8g6o$q5q$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=190&group=comp.os.linux.networking#190

  copy link   Newsgroups: comp.os.linux.networking
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: unr...@invalid.ca (William Unruh)
Newsgroups: comp.os.linux.networking
Subject: Re: Connecting to an SSH server from the external world
Date: Mon, 14 Jun 2021 21:03:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <sa8g6o$q5q$1@dont-email.me>
References: <s8rnfh$qp2$1@gioia.aioe.org>
<slrnsb3ql0.9a0.h_hucke+spam.news@romulus.aeon.icebear.cloud>
<s8v14o$c2g$1@server.snarked.org> <60b36e50$0$21617$426a74cc@news.free.fr>
<s94ebe$1os$4@tncsrv09.home.tnetconsulting.net>
<60b66393$0$32499$426a74cc@news.free.fr>
<s966gd$gnc$1@tncsrv09.home.tnetconsulting.net>
<60b8b3fd$0$32507$426a74cc@news.free.fr>
<s9cboj$13j$1@tncsrv09.home.tnetconsulting.net>
<60bbb36f$0$27424$426a74cc@news.free.fr>
<s9gui7$773$1@tncsrv09.home.tnetconsulting.net>
<60c47b5d$0$3709$426a34cc@news.free.fr>
<sa2pu8$1ve$1@tncsrv09.home.tnetconsulting.net>
<60c5f22b$0$27428$426a34cc@news.free.fr> <sa5gqs$rfr$1@dont-email.me>
<60c768fa$0$27429$426a74cc@news.free.fr>
<sa848e$63j$1@tncsrv09.home.tnetconsulting.net>
Injection-Date: Mon, 14 Jun 2021 21:03:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="67c2f494a404142cb8f70663c0ea7869";
logging-data="26810"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dkMR2kme3oZ4phabZ/cVx"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Byi/Wd7RMIoIH8fDWgdBFVSuYR8=
 by: William Unruh - Mon, 14 Jun 2021 21:03 UTC

On 2021-06-14, Grant Taylor <gtaylor@tnetconsulting.net> wrote:
> On 6/14/21 8:34 AM, Pascal Hambourg wrote:
>> Of course it does.
>
> I agree with William. I don't believe that each individual source IP
> needs individual port knock sequences.
>
>> You don't want to allow your "neigbour" which is eavesdropping on
>> your traffic to replay the port knocking sequence you just sent.
>
> I don't care about my neighbor. I care about random malware not being
> able to get to my SSH daemon.
>
> There's also the fact that my neighbor - who's not on my LAN - is going
> to have trouble eavesdropping on the port knock sequence.
>
>> This is exactly what we are discussing in that part of the thread : port
>> knocking implemented with iptables as someone suggested.
>
> Which is entirely possible to do, especially with loose granularity.
> I've done it multiple times.
>
>> No, you need different one rule per single address to prevent port
>> knocking replay.
>
> Not if you don't care about knock reply.
>
> It really depends on what you're trying to use port knocking to protect
> against. If you're trying to simply reduce noise from SSH brute force
> attempts, then you very likely don't care about knock reply protection.
> If you're trying to protect against someone else in the coffee shop
> replaying and attacking you personally, well, a port knock sequence no
> matter how complex, probably won't suffice and you need a different
> solution.
>
>

You could also do something like. "knock on port A, where you do not
care if anyone knows port A." That triggers a subrouting on both your
travel machine and your home machine to encrypt the IP address your
remote machine and use that to determine a port number for the next
knock. Both the home machine and the touring one use the same key for
the encryption so both know, but noone else does, what the next port is
to knock at. So you then knoch on that port, and the ssh port is then
opened. (or even use that encrypted port as the ssh port). To prevent
replay, the encryption mixes the current UTC (to the nearest minute say)
time with the IP address to encrypt to find the next port. You also do
not let in another attempt on that port in that minute, to prevent
replay. Ie, if you screw up, say your ssh password at logon. You have to
wait a minute to try again, but then who says security is a free ride:-)

>

Re: Connecting to an SSH server from the external world

<sa8l2f$sal$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=191&group=comp.os.linux.networking#191

  copy link   Newsgroups: comp.os.linux.networking
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: unr...@invalid.ca (William Unruh)
Newsgroups: comp.os.linux.networking
Subject: Re: Connecting to an SSH server from the external world
Date: Mon, 14 Jun 2021 22:26:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <sa8l2f$sal$1@dont-email.me>
References: <s8rnfh$qp2$1@gioia.aioe.org>
<slrnsb3ql0.9a0.h_hucke+spam.news@romulus.aeon.icebear.cloud>
<s8v14o$c2g$1@server.snarked.org> <60b36e50$0$21617$426a74cc@news.free.fr>
<s94ebe$1os$4@tncsrv09.home.tnetconsulting.net>
<60b66393$0$32499$426a74cc@news.free.fr>
<s966gd$gnc$1@tncsrv09.home.tnetconsulting.net>
<60b8b3fd$0$32507$426a74cc@news.free.fr>
<s9cboj$13j$1@tncsrv09.home.tnetconsulting.net>
<60bbb36f$0$27424$426a74cc@news.free.fr>
<s9gui7$773$1@tncsrv09.home.tnetconsulting.net>
<60c47b5d$0$3709$426a34cc@news.free.fr>
<sa2pu8$1ve$1@tncsrv09.home.tnetconsulting.net>
<60c5f22b$0$27428$426a34cc@news.free.fr> <sa5gqs$rfr$1@dont-email.me>
<60c768fa$0$27429$426a74cc@news.free.fr>
<sa848e$63j$1@tncsrv09.home.tnetconsulting.net>
<sa8g6o$q5q$1@dont-email.me>
Injection-Date: Mon, 14 Jun 2021 22:26:24 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9d58e249e628f8df51a2f81b7cb9fc45";
logging-data="29013"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/GeAj/ASjVh5ijYD4+ujj"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:bcNtwxW5NEP2ZaNgcNXIfb74+10=
 by: William Unruh - Mon, 14 Jun 2021 22:26 UTC

On 2021-06-14, William Unruh <unruh@invalid.ca> wrote:
> On 2021-06-14, Grant Taylor <gtaylor@tnetconsulting.net> wrote:
>> On 6/14/21 8:34 AM, Pascal Hambourg wrote:
>>> Of course it does.
>>
>> I agree with William. I don't believe that each individual source IP
>> needs individual port knock sequences.
>>
>>> You don't want to allow your "neigbour" which is eavesdropping on
>>> your traffic to replay the port knocking sequence you just sent.
>>
>> I don't care about my neighbor. I care about random malware not being
>> able to get to my SSH daemon.
>>
>> There's also the fact that my neighbor - who's not on my LAN - is going
>> to have trouble eavesdropping on the port knock sequence.
>>
>>> This is exactly what we are discussing in that part of the thread : port
>>> knocking implemented with iptables as someone suggested.
>>
>> Which is entirely possible to do, especially with loose granularity.
>> I've done it multiple times.
>>
>>> No, you need different one rule per single address to prevent port
>>> knocking replay.
>>
>> Not if you don't care about knock reply.
>>
>> It really depends on what you're trying to use port knocking to protect
>> against. If you're trying to simply reduce noise from SSH brute force
>> attempts, then you very likely don't care about knock reply protection.
>> If you're trying to protect against someone else in the coffee shop
>> replaying and attacking you personally, well, a port knock sequence no
>> matter how complex, probably won't suffice and you need a different
>> solution.
>>
>>
>
> You could also do something like. "knock on port A, where you do not
> care if anyone knows port A." That triggers a subrouting on both your
> travel machine and your home machine to encrypt the IP address your
> remote machine and use that to determine a port number for the next
> knock. Both the home machine and the touring one use the same key for
> the encryption so both know, but noone else does, what the next port is
> to knock at. So you then knoch on that port, and the ssh port is then
> opened. (or even use that encrypted port as the ssh port). To prevent
> replay, the encryption mixes the current UTC (to the nearest minute say)
> time with the IP address to encrypt to find the next port. You also do
> not let in another attempt on that port in that minute, to prevent
> replay. Ie, if you screw up, say your ssh password at logon. You have to
> wait a minute to try again, but then who says security is a free ride:-)
>
>>

So. Make sure both machines are running chrony or ntp to make sure that
both have the system time accurate to a minute say.

Port K on the home machine simply runs a little program which reflects
back the IP address that it sees coming in. That is to make sure that
you know what your own IP address is on the mobile machine. You now
concatente that IP address with the the time to the minute, hash is with
some suitable hash, encrypt it with some encryption routing and common
password and connect to the home machine on the port corresponding to
the 1000+last six bits of that encryption. Meanwhile the home machine
has done the same-- hashed the concatenationof the incoming IP with the
time to the nearest minute and encrypted it with the encryption with the
common password, and started sshd on that port. Now the remote machine
connects to that port as usual. Then sshd no longer
responds to that port. If there is a second knock on the port with on
the same date, the knock port does not respond. This means a replay will
not work. This also makes the port as secure as the two passwords (one
the knock password, and the other the ssh password).

The knock program is extremely simple, so its security can be assured
(It just listens, reflects back the incoming IP, and encrypts the
incoming IP and starts sshd on the resultant port number, and refuses to
respond to any more knocks until the minute has passed. That program
should be able to guarentee security of. Then one still has to log onto
ssh with the ssh logon security.

Then one still has the security of ssh.

Re: Connecting to an SSH server from the external world

<sf1626$d7r$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=192&group=comp.os.linux.networking#192

  copy link   Newsgroups: comp.os.linux.networking
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bere...@nun-ya-bizness.com (Johann Beretta)
Newsgroups: comp.os.linux.networking
Subject: Re: Connecting to an SSH server from the external world
Date: Wed, 11 Aug 2021 11:48:38 -0700
Organization: None Of Your Business
Lines: 13
Message-ID: <sf1626$d7r$2@dont-email.me>
References: <s8rnfh$qp2$1@gioia.aioe.org> <s8svu8$96r$1@milena.home.net.it>
<s8tr1m$h6i$1@news1.tnib.de> <s8tsps$mmb$1@milena.home.net.it>
<s8u0mn$4ma$1@dont-email.me> <20210529172613@news.eternal-september.org>
<s8v6aj$ch8$1@dont-email.me> <60b370d9$0$21599$426a74cc@news.free.fr>
<s90idj$lqo$1@news1.tnib.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 11 Aug 2021 18:48:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8eb80508dd9d8f7f2be88856df9287b8";
logging-data="13563"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+41+7cN5R8+yYc27BXlwi9nAsChc84rhk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Dc+RL3fy5+o2GnNzAkozJolpLFM=
In-Reply-To: <s90idj$lqo$1@news1.tnib.de>
Content-Language: en-US
 by: Johann Beretta - Wed, 11 Aug 2021 18:48 UTC

On 5/30/21 10:35 AM, Marc Haber wrote:

> minute) with acceptable results and no complaints from the users.
>
> My other machines have an access list making port 22 only available
> from my own IPv6 address range.
>
> Greetings
> Marc
>

Step 1. Don't use the default port #s. That will stop a lot of drive-by
attacks that are part of automated systems.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor