Lennart Poettering's Run0

The place to discuss Linux and Unix Operating Systems
Forum rules
Behave
Post Reply
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Lennart Poettering's Run0

Post by Zema Bus »

Overnight systemd lead developer Lennart Poettering wrote on Mastodon around systemd's newest effort: run0 as a sudo-like command.
Coming for systemd 256 is "run0" as a sudo clone. Due to long-standing issues with sudo, Lennart wrote of run0:

There's a new tool in systemd, called "run0". Or actually, it's not a new tool, it's actually the long existing tool "systemd-run", but when invoked under the "run0" name (via a symlink) it behaves a lot like a sudo clone. But with one key difference: it's *not* in fact SUID. Instead it just asks the service manager to invoke a command or shell under the target user's UID. It allocates a new PTY for that, and then shovels data back and forth from the originating TTY and this PTY. Or in other words: the target command is invoked in an isolated exec context, freshly forked off PID 1, without inheriting any context from the client (well, admittedly, we *do* propagate $TERM, but that's an explicit exception, i.e. allowlist rather than denylist).

One could say, "run0" is closer to behaviour of "ssh" than to "sudo", in many ways.
...
The tool is also a lot more fun to use than sudo. For example, by default it will tint your terminal background in a reddish tone while you are operating with elevated privileges. That is supposed to act as a friendly reminder that you haven't given up the privileges yet, and marks the output of all commands that ran with privileges appropriately


Those wishing to learn more about systemd's run0 as a sudo alternative can see more of Lennart's commentary on Mastodon.social.
From phoronix.com
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Lennart Poettering's Run0

Post by Grogan »

I heard about that, I'm not really interested in using that, or surrendering any more functionality to systemd for that matter lol

I don't like sudo either, but the whole point is granting privileges. Some things might use sudo at the back end (e.g. some file manager) but otherwise it's unused on my system. I just use su and I make sure my environment has what I need with or without login shell hyphen -

I'm more of a mind that nobody is going to have root or sudo unless they are special people anyway. If I'm going to trust them with any of that privilege elevating stuff, I might as well just let them in on the root password if they are to be performing administrative tasks. The rest could be done with user groups etc. for users needing access to hardware and such. Obviously here, it's me-only... I could run my computers as root with blank passwords for all I care. I don't, because the environment has been carefully set up so I don't have to (unlike Windows, though it has gotten better with a more reasonable implementation of UAC so you don't really have to shut that off either anymore)

(off on a tangent... I just remembered something cool. I hate that word "privileges". Novell Netware called it "Rights" :-) )
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Lennart Poettering's Run0

Post by Zema Bus »

I've always preferred su as well.
Post Reply