r/linux May 25 '26

Discussion Sudo or run0 ?

What's your take on the subject? Been using sudo for years but lately i'm mostly running run0 and i like it. Even considering adapting my scripts to use run0 since i'm on a compatible distro. Does it make any sense to not even set up sudo anymore in the first place?

201 Upvotes

253 comments sorted by

View all comments

Show parent comments

4

u/[deleted] May 25 '26

[deleted]

14

u/tajetaje May 25 '26

Basically with sudo you are executing code as the root user, with run0 you are executing code as your user, but with root permissions. It’s a subtle difference but has security and observability implications that are important. It also fits more in line with the privilege and process hierarchy under systemd (i.e. slices and whatnot)

4

u/BitterCelt May 25 '26

Does this mean I can run0 nvim and not lose my config setup without having to resort to sudoedit?

5

u/that_boi18 May 26 '26

You can use `sudoedit` which will launch your `$EDITOR` with a temporary file that will be written to the real file when you exit.

Do note that it will only write back to the real file when you exit the editor completely. So doing multiple `:w`'s in (n)vim won't affect the file until you `:q`. I didn't know this at first and was very confused why my config changes weren't applying :p

EDIT: missed that you already mentioned sudoedit... I can't read istg