I’ve got a ticket or three open with SH, but as far as I can tell simplegateway is spawned by a LaunchAgent on macOS. This is an understandable as it’s a requirement for the Remote Desktop functionality to work.
As a primer for those that don’t know, SH’s Remote Access LaunchAgent spawns the simplegateway as root when a macOS box is at the Loginwindow. When running at the loginwindow, SH tools/alerts/terminals run as root. Once a user logs into the box, the LaunchAgent re-spawns simplegateway as the user. This allows for remote access, but tools/alerts/terminals run as the user.
Why this matters is most macOS boxes that aren’t in labs are virtually never logged out. True for desktops and even more so for laptops, so no privileged automation can occur.
What I’m trying to work out is if I’m missing some mechanism that SH has in place to run privileged/root tools/alerts/terminals while a user is logged in. I’d expect one of two solutions. I can’t see any signs of either on my 5.1.8 trial.
-
A privileged helper tool would be the most “correct” way to handle this, It’s a non-trivial bit of coding, but would provide a secure privileged helper that simplegateway could call to run tools/alerts as root. Terminals could be spun up with the privileged helper, but I think it would require spawning another simplegateway.
-
A LaunchDaemon that spawns a simplegateway running as root. The SH server would need to manage the sessions and send/process tools/alarms/terminals to the LaunchDaemon spawned simplegateway.
I disabled the LaunchAgent and created a LaunchDaemon for simplegateway. Of course Remote Desktop does not work and isn’t even offered. Tools/Alarms functioned and executed as root. However , no sessions function, no terminal, diagnostics, or tunnels. Surprised/not surprised. I can understand the need for running as the user for remote control, but I’m surprised for the need on file sharing and tunnels. Terminals seem like a visual representation of the terminal, so maybe that’s the issue there.
If you read to here you’re a bit of a masochist or running into the same issue as me. Fingers crossed that I’m just missing something obvious.