Comment by pojntfx

6 months ago

It's fun, leading edge Linux distros (e.g. GNOME OS) are actually currently removing `sudo` completely in favour of `run0` from systemd, which fixes this "properly" by using Polkit & transient systemd units instead of setuid binaries like sudo. You get a UAC-style prompt, can even auth with your fingerprint just like on other modern OSes.

Instead of doing this, Ubuntu is just using a Rust rewrite of sudo. Some things really never change.

You make it sound like there was a discussion where they looked at these two alternatives and chose improving sudo over using run0. Actually I just submitted a patch for this and they accepted it. I don't work for Ubuntu and I didn't even know run0 existed until now (it does sound good though; I hope they switch to that).

Why is running a command as an ephemeral systemd unit better? Just curious, I don't have an opinion one way or the other.

Without knowing more, creating a transient unit just to run a single shell command seems quite roundabout.

Ubuntu truly are masters of going all in on being different in a worse way, only to about face soon thereafter.

You'd think by now they'd have learned, but apparently not.

  • Courage to be different is an open door to creativity.

    Yes, it means going in a wrong direction sometimes as well: that's why it takes courage — success ain't guaranteed and you might be mocked or ridiculed when you fail.

    Still, Ubuntu got from zero to most-used Linux distribution on desktops and servers with much smaller investment than the incumbents who are sometimes only following (like Red Hat).

    So perhaps they also did a few things right?

    (This discussion is rooted in one of those decisions too: Ubuntu was the first to standardize on sudo and no root account on the desktop, at least of mainstream distributions)

    • Ubuntu became the most used because they were the first to really dumb down the install process. No insult intended, it was my first distro as well. If you weren't around, it was rather stark. Most others had install media that just loaded a curses based install menu, asking you about partioning. Ubuntu gave you a live environment and graphical installer, which didn't ask any hard questions... way ahead of their time.

      Nobody picked Ubuntu because of Mir, or Compiz, or Upstart(or snaps, while we're on the topic). They were obvious errors. That it's popular doesn't negate that fact.

      7 replies →

  • > You'd think by now they'd have learned, but apparently not.

    No. Suffering is the crucial part of virtue signaling, so bugs in slop rewrites are a feature, not a bug.

It's possible to auth with your fingerprint (or even a YubiKey) in sudo. It's a functionality provided by PAM, after all.

How can you stop it asking your password every single time? I asked my LLM and it hallucinated Javascript at me.

  •   echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee "/etc/sudoers.d/$USER"; sudo chmod 0600 "/etc/sudoers.d/$USER"
    
      sudo mkdir -p /etc/polkit-1/rules.d
    
      echo 'polkit.addRule(function(action, subject) { if (subject.isInGroup("sudo") || subject.isInGroup("wheel")) { return polkit.Result.YES; }});' | sudo tee /etc/polkit-1/rules.d/00-nopasswd.rules

Gnome is known for shitty UX, breaking stuff every release and refusing to fix stuff since Gnome3.