News for hackers. Stuff that matters.
Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Wednesday August 28, 2024 @11:17AM (#41380480)
I know that, but "public keys" is long enough on mobile without typing "public user-authentication keys."

Anyway, I think it is reasonable to assume that if you're using the "escape hatch" as mentioned by /u/nine_k, you may well not have your .ssh/known_hosts file on your client. In which case public user-authentication keys minimizes your blast radius of a MitM host.

Also, a compromised (but legitimate) host could still grab your password and try lateral movement (mitigated if you don't reuse your break-glass password, but you get it for free with public keys).

Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Wednesday August 28, 2024 @11:42AM (#41380742)
I could host my known_hosts file at a https URL.
Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Wednesday August 28, 2024 @12:01PM (#41380981)
And yet syncing an encrypted private key is still easier and more secure than syncing (via the same mechanism e.g. Keepass) a 30-character random password.
Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Wednesday August 28, 2024 @01:26PM (#41381840)
You don't need a 30 character random password for SSH to your machine; that's a strawman.

The attackers are not cracking a password hash with GPUs; they are just connecting and guessing.

People who use passwords with SSH of course use passwords they can remember and type.

If the attackers are trying to brute-force your password by attacking the hash, that means the machine was already compromised. The password then has no value, unless you're re-using it for other machines.

The user who thinks they need a 30 character random password for SSH (if they were to use one) will of course opt for keys instead.

Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Wednesday August 28, 2024 @02:24PM (#41382581)
A strawman??? It's _word for word_ the suggestion I was responding to in my original comment, how is that a strawman???
Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Wednesday August 28, 2024 @02:45PM (#41382810)
I see user nine_k introduced that. It's still a strawman; nobody needs 30 random characters for a SSH password (except in some circumstances in which a key would obviously be better).

Let's assume I have an uncommon user name (not root or www-data, ...) and not anything from my domain name or e-mail address or whatever, and a nine character password made of lower case characters and digits, reasonably easy to remember.

Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Wednesday August 28, 2024 @03:03PM (#41383009)
Well great, so I'm addressing nine_k and his question/scenario. As I have been this entire time. And it sounds like you're _agreeing_ that a 30-character random password makes no sense, and a key is easier and better. No?

Regarding _your_ scenario, cool bro, do whatever you want. However, if you reuse that password for any other servers, you're open to lateral movement attacks, which keys mitigate.

Actually I guess that's my main argument: you can mitigate the downsides of passwords, but keys are super simple, well-supported, and require no such fussiness. Just generate it, set a password, authorize it, forget it. Threats mitigated. If you want to futz about with workarounds, be my guest. I have no such desire.

Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Wednesday August 28, 2024 @03:21PM (#41383193)
Anything is better than a 30 character password, including quitting computing and just doing vegetable farming on a tiny island, completely off every grid.

BTW, that remark I made about known_hosts applies to keys. You could put your SSH client keys (I mean private ones) on some HTTPS URL, so that you could fetch them to a brand new machine (e.g. burner phone purchased abroad).

And that's back to passwords: anyone else knowing that URL could fetch those keys, and their security depends on their password phrase. So we are back to relying on the strength of a password phrase as well as faith in attackers not knowing anything about such an URL.

Oh right; the URL could be .htpasswd protected too, let's not forget. :)

Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Wednesday August 28, 2024 @03:36PM (#41383337)
Re: hosting your key, I think that's quite reasonable, again, assuming your access control + encryption is good. It's a solid break-glass solution. I would add monitoring that alerts if it is ever used, though. Then you can remediate quickly on the off-chance it is compromised. In day-to-day use I would stick with a different key that only lives on my machine.
Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Thursday August 29, 2024 @10:05AM (#41390961)
> assuming your access control + encryption is good

Accessing a password-protected page over https is pretty much exactly the same access control + encryption as using a password with SSH.

Re:Knockknock: Simple, secure, and stealthy port knocking im... by KAMSPioneer on Friday August 30, 2024 @03:16AM (#41398402)
That's access control and transport encryption. By encryption I meant the encryption of the private key itself. I would not upload a plaintext private key, especially for privileged account access, even to a server I control.
Re:Knockknock: Simple, secure, and stealthy port knocking im... by nine_k on Wednesday August 28, 2024 @03:38PM (#41383357)
A strawman indeed. 30 characters is deliberate overkill.

So, thank you for confirming my understanding: keys are just as / more convenient from the ops standpoint than passwords. The weakness is only in short, guessable passwords.

Re:Knockknock: Simple, secure, and stealthy port knocking im... by kazinator on Wednesday August 28, 2024 @07:31PM (#41385544)
Short, guessable passwords are another strawman. There are short passwords which are unguessable. Those passwords are crackable from their hash, which is different from guessable.