Live data from Hacker News

Non-interactive SSH password authentication

vincent.bernat.ch

121–128 of 128 posts

Re: Non-interactive SSH password authentication

#121
post #97
post #71

Earlier quoted context omitted.

If you want a session with extra permissions you use an appropriate Kerberos principal, e.g. admin/...

I know. This practice of having two user accounts sucks.

Suid and ambient authority suck. I'd rather a more principalled approach.

Re: Non-interactive SSH password authentication

#122
post #87

Earlier quoted context omitted.

Right (what's the threat model)? The possibilities of restricted passphrase-less keys are under-appreciated for non-interactive use, or even interactive use. I'd rather mint an ephemeral key for an endpoint I control than type credentials or, worse, forward the agent, if I have to call out of an untrusted system (like an HPC login node).

I mean, the use case is I want my GUI wrapper to interactively prompt the user for the decryption password. It’s not getting saved to disk; I just want ssh capabilities (including password protected ssh keys) inside an interactive desktop app.

I can't tell what that involves but, for instance, the two GUI things I typically use with SSH are Emacs (openssh) and x2go (libssh), and they don't do that. Surely you want the agent anyway.

Re: Non-interactive SSH password authentication

#123

Earlier quoted context omitted.

You have a fundamental misunderstanding of footguns, and humans. Explaining them is in manual doesn't mean they no longer exist. People often don't read the manual. Nor should they have to. > If you aren't good with shell scripts, why bother? Go use Python or something else entirely I agree! And given that essentially nobody is "good with shell scripts" we can simplify that advice to "don't write shell scripts".

> People often don't read the manual. Nor should they have to. That's some kind of logic right there. If people don't read the manual, they have every right to expect that things will break. It's not surprising or shocking, it's just user error. > we can simplify that advice to "don't write shell scripts". No, we cannot simplify it like that. Shell scripts are a brilliant tool for a certain kind of problem, and they…

> If people don't read the manual, they have every right to expect that things will break.

This is just fundamentally and absolutely wrong. Completely incorrect.

I could explain it, but others have done better:

https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...

https://notes.rmhogervorst.nl/post/2022/11/21/what-is-a-foot...

https://fstoppers.com/opinion/stop-telling-people-read-manua...

I also recommend the book "The design of everyday things" which isn't about software but the lessons in it are highly applicable.

Good luck learning!

Re: Non-interactive SSH password authentication

#124

The author claims that sshpass is "broken by design" and goes on to show some examples of why, without ever explaining anything. Can anyone enlighten me why sshpass is broken, or explain the examples on that page?

You are probably asking about the passh page. Examples there show that sshpass creates a new permanent tty entry with each use, while passh does not. More importantly though is that sshpass keeps your password permanently on your computer, thus increasing security risks considerably.

Yeah, but that's my question, why is all that stuff about TTYs bad? The examples basically say:

bad:

   bash-4.4# tty
   /dev/pts/18     // the bash's stdin is also connected to pts/18
good:

   bash-4.4# tty
   /dev/pts/18     // the bash's stdin is connected to the new pts/36
...and stuff about controlling terminals and missing job control, but why are these things bad?

And yes, if I use either sshpass or passh, the password will have to be "on my computer" (i.e. in a script or text file), that's the whole point of it: accessing devices that don't do public-key authentication non-interactively

Re: Non-interactive SSH password authentication

#125
post #47
post #22

Earlier quoted context omitted.

Author here. I don't claim sshpass is "broken by design". I claim it is brittle as it relies on the detection of a password prompt. passh author has several examples here: https://github.com/clarkwang/passh/blob/master/sshpass-broke... .

https://github.com/clarkwang/passh/ On the sidebar, in the about, it says, > sshpass is broken by design This is another repo. But probably where they got it.

yeah, sorry, I was under the impression that the autor was also the author of that repo.

Re: Non-interactive SSH password authentication

#126
post #15

The author claims that sshpass is "broken by design" and goes on to show some examples of why, without ever explaining anything. Can anyone enlighten me why sshpass is broken, or explain the examples on that page?

I’ve always been told that ssh is not supposed to work non-interactively. Which is the whole reason for sshpass, to work non-interactively. Ie. Broken by design.

I totally agree, but sometimes you have no other choice (e.g. devices that only offer password auth), and in that case it is claimed that sspass is bad ("broken by design" according to the passh author) and passh is good. And that's what I'm confused about

Re: Non-interactive SSH password authentication

#127
post #22

The author claims that sshpass is "broken by design" and goes on to show some examples of why, without ever explaining anything. Can anyone enlighten me why sshpass is broken, or explain the examples on that page?

Author here. I don't claim sshpass is "broken by design". I claim it is brittle as it relies on the detection of a password prompt. passh author has several examples here: https://github.com/clarkwang/passh/blob/master/sshpass-broke... .

Sorry, I was under the impression that you were also the author of passh. I take that statemen back, obviously (can't edit my post anymore)

Re: Non-interactive SSH password authentication

#128

Earlier quoted context omitted.

Public key authentication is actually a Must Implement for SSHv2. Since SSHv1 is long obsolete, any gear that doesn't have pubkey doesn't actually have a de jure SSH implementation. "All implementations MUST support this method"

And if you don't, anyway? Do you not get to use the SSH(TM) logo on your product? You're reading MUST a bit too literally.

Exactly as I wrote, it means what you've got isn't a de jure SSH implementation.

Do with that whatever you will.

Post reply on HN