!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

346 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.125 Servers

Load older messages


SenderMessageTime
22 Apr 2025
@molly:161.rocksMolly(https://skarnet.org/software/s6/notifywhenup.html is what i was aiming for, but passing file descriptors around with the ssh client is a bit fiddly with how proactively openssh locks everything down, so i've implemented it with some socket fd passing)09:42:23
@k900:0upti.meK900Honestly I wonder if the real solution for this is to just do capnp over mTLS or something09:42:58
@molly:161.rocksMollyssh has the advantage that it's already there in most cases and already has its own authn/authz in place09:45:06
@irenes:matrix.orgIrenesit does feel like tls or mtls with mutual authentication would be the better solutions to a lot of things ssh gets used for09:45:08
@qyriad:katesiria.orgQyriad
In reply to @k900:0upti.me
My login shell is nushell
this kind of thing is why we set our login shell to zsh and just make all our terminal emulators spawn xonsh lol
09:45:19
@irenes:matrix.orgIrenesbut I understand wanting to leverage existing, well-understood stuff09:45:25
@k900:0upti.meK900 Yes, and the disadvantage that we're using it for the exact thing they DON'T want people doing 09:45:28
@molly:161.rocksMollymmm09:45:53
@molly:161.rocksMollythere's some prior art for using a separate ssh subsystem for other use cases, i seem to recall the RPKI routing security stuff uses a separate subsystem when using ssh as a transport09:47:14
@helle:tacobelllabs.nethelle (just a stray cat girl)
In reply to @molly:161.rocks
there's some prior art for using a separate ssh subsystem for other use cases, i seem to recall the RPKI routing security stuff uses a separate subsystem when using ssh as a transport
yeah, openssh really wants people to consider subsystems for this
09:48:11
@molly:161.rocksMolly(which i presume is a result of one of the big players who's pushed the rpki stuff forward also being openbsd and openssh adjacent)09:48:14
@helle:tacobelllabs.nethelle (just a stray cat girl)btw for me the reasoning for wanting to stick with ssh for this is, it already has good auth* and not exposing more of an attack surface for that09:48:54
@molly:161.rocksMollyopenssh is also something which people know already, which may or may not be a useful property09:49:33
@molly:161.rocksMolly(i should make it clear that i don't have a horse in this race, i just saw the conversation go past and it sparked my interest >_>)09:49:54
@irenes:matrix.orgIrenesyeah doing auth right is hard09:50:15
@irenes:matrix.orgIrenesor at least, it requires planning09:50:43
@helle:tacobelllabs.nethelle (just a stray cat girl)I only have one because of implementing subsystems and even chrooting them before, anyway, brb, need to consume breakfast and all that before we can dig up the notes, lol09:51:05
@molly:161.rocksMolly(now that i've mentioned that, the bird routing daemon also decided to use libssh for accessing rpki data sources over an ssh transport)09:53:43
@kfears:matrix.orgKFears (burning out)
In reply to @k900:0upti.me
Honestly I wonder if the real solution for this is to just do capnp over mTLS or something
I mean, honestly, yes
10:58:27
@kfears:matrix.orgKFears (burning out)But it's not yet10:58:40
@helle:tacobelllabs.nethelle (just a stray cat girl)

okay, going over this and looking at our notes, in all cases even for Subsystem, sshd will always use the user's login shell as it currently stands, fixing this on the ssh side at least for subsystems would be surprisingly trivial (we had considered doing this when running into an issue with chrooting and securing ssh), but let's ignore that for now (yeah, we are scared to contribute code anywhere)

all shells, no matter how otherwise limited at being posix do seem to support "-c" and hence ssh running a remote command does work, just you cannot rely on anything but launching an executable, because of shell feature difference

the simple solution hence would be to make nix-daemon launchable as simple as possible and include a way to let it produce the "started" (technically a user could use a wrapper script for this), you could even consider not needing arguments to do this, so even the most rudimentary argument parsing does not need to work

we would actually say that print "started" should probably still be the case (communicating that "yes, you are connected to a working nix-daemon) even if we replace calling ssh with using libssh, because the shell may have mangled setup, etc so having a clear way of detecting we are actively communicating makes sense

relatedly, if there are issues specifically to stdio we could instead use port forwarding to forward a unix socket instead, this is reliable and avoids the inband nature of the shell potentially giving us output on stdout that we don't know how to handle

12:59:37
@piegames:flausch.socialpiegames

sshd will always use the user's login shell as it currently stands

👀 Is there really no unintrusive way around this?

13:02:07
@piegames:flausch.socialpiegamesThis sounds so bad yet sadly plausible13:03:03
@helle:tacobelllabs.nethelle (just a stray cat girl)
In reply to @piegames:flausch.social

sshd will always use the user's login shell as it currently stands

👀 Is there really no unintrusive way around this?

nope, we ran into this hard, we tried everything and read the entire code on how commands, ForceCommand, Subsystem, etc works
13:03:41
@helle:tacobelllabs.nethelle (just a stray cat girl) even ForceCommand (and hence Subsystems) rely on the user having a login shell, it is why git-shell exists to hand accounts as a login shell if they only should be doing git things 13:14:50
@helle:tacobelllabs.nethelle (just a stray cat girl)oh, from the manpage, yes "If a command is specified, it will be executed on the remote host instead of a login shell." is a total lie13:19:37
@k900:0upti.meK900I spoke to horrors a bit13:21:00
@k900:0upti.meK900And I'm starting to be convinced that we can just drop the "started" hack 13:21:16
@k900:0upti.meK900It's a band-aid for a very specific failure mode13:21:32
@k900:0upti.meK900That you're also wildly unlikely to hit 13:21:40

Show newer messages


Back to Room ListRoom Version: 10