Live data from Hacker News

Run0, a systemd based alternative to sudo, announced

mastodon.social

601–610 of 902 posts

Re: Run0, a systemd based alternative to sudo, announced

#601

Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge? I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

Sudo isn't baked into the system. It's an application.

https://www.sudo.ws/

Did you read the thread linked?

Re: Run0, a systemd based alternative to sudo, announced

#602

Earlier quoted context omitted.

>think of it as learning one tool which works for everything. For how long? I've been around for decades at this point with people telling me how the newest and greatest thing will obsolete everything that came before it. The best way to look through logs is still to materialize them in as text in a files hierarchy and use find with grep to look for issues.

> For how long? Debian switched to systemd about 12 years ago, so at least that long.

Find came out in 1974.

Re: Run0, a systemd based alternative to sudo, announced

#603

Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge? I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

Pretty sure `sudo` is an application that you can remove, it just comes pre-installed in many distros.

Not only that, but it became commonly included only about 20 years ago. I spent my first years with Linux calling ‘su’ instead.

I still run some very old distribution (e.g. RedHat 6.2) on a Pentium 1 laptop, and I downloaded the source of sudo and compiled it on it, since the sources were not even included in the extended CD set.

Re: Run0, a systemd based alternative to sudo, announced

#604

Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge? I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

Sudo is a program that:

1. Parses the sudoers file to check if the current user can run the command provided.

2. If so, authenticates the user using PAM.

3. If both those pass, sets the user id to root and runs the program.

There is nothing special about it. All steps can be done by any program. In fact sudo is usually not even an installed by default package in many systems.

The only seeming magic bit is part 3, where the program sets it's user id to root. Obviously if any program could do this... That'd be unsafe.

However, unix systems allow any executable file to have their flags changed to include the setuid bit which causes the file to execute with privileges of the files owner. You'll notice that the sudo binary has this bit set and it's owned by root, which explains now the entire process.

Re: Run0, a systemd based alternative to sudo, announced

#605

Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge? I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

sudo, and even cd and ps you mention are simply binaries that come shipped with your distro / OS. They, like explorer.exe on Windows, are an essential part of that OS with special privileges and roles but they are not part of the kernel, they are still simply programs. It is not developed by the people who develop the Linux kernel. There are other Sudo alternatives such as DoAs already.

While some systems include a "cd" binary, it's basically useless since it just changes its own working directory and then exits.

Instead, "cd" commands are generally parsed and executed by your shell (/bin/sh or similar) directly so that the shell's working directory gets changed and you can run subsequent commands in the new location.

"ps" on the other hand is indeed just a normal program. Usually it reads files in /proc to figure out which processes are running.

Re: Run0, a systemd based alternative to sudo, announced

#606

I have seldom come across unix multiuser environments getting used anymore for servers. Its generally just one user on one physical machine now a days. I understand run0's promise is still useful but i would really like to see the whole unix permission system simplified for just one user who has sudo access.

I haven’t seen it doesn’t mean it doesn’t exist.

Re: Run0, a systemd based alternative to sudo, announced

#608

Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge? I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

> I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’.

Neither of these are “baked into the entire system” for any meaningful sense of the word. `cd` is just a shell builtin and is casually reimplemented in every single shell. It’s just environment state within your session. `ps` is just a binary that (on Linux) parses stuff in /proc.

None of it is magic. Neither is sudo. It’s just a binary like any other (though in sudo’s case, it’s setups, which is how it can cross the permissions boundary).

Re: Run0, a systemd based alternative to sudo, announced

#609
post #415

Earlier quoted context omitted.

I've never understood the need for sudo(1) on single-user, physical machines: I keep a root shell (su(1)) around for admin tasks, and it's always been sufficient.

Everything I run with sudo is logged so I know how I messed up. Nothing worse than ansible with its “sudo /tmp/whatever.sh” which hides what it’s doing.

> Everything I run with sudo is logged so I know how I messed up.

FWIW, shells have a (configurable) history file. I'm not sure how it compares to sudo's logging though. I also personally perform little day to day admin tasks (I don't have as much time nor interest to toy around as I used to, and my current setup has been sufficient for about a decade).

> Nothing worse than ansible with its “sudo /tmp/whatever.sh” which hides what it’s doing.

That's a nightmare indeed; for sensitive and complex-enough tasks requiring a script, those scripts should at least be equipped with something as crude as a ``log() { printf ... | tail $logfile`` }.

Post reply on HN