'When should I use runuser command?

My question is quite simple:
When should I use runuser to run a command as another user when I am root, instead of sudo or su command?

Looks like they all are same, I really don't get the difference.



Solution 1:[1]

(Answering Community Wiki to avoid getting rep for answering a clearly-offtopic question).

runuser is only for dropping permissions. Thus, it can be installed on systems designed by someone too cautious to permit su or runuser, both of which require a setuid bit (and so can escalate an arbitrary unprivileged user to root in the presence of a bug or misconfiguration; bugs in sudo in particular are not unheard of).

If you're writing software for such a system, you must use runuser.

If you're writing software to be run on completely arbitrary systems, and don't want to depend on setuid executables, you might want to choose something less Linux-specific than runuser -- personally, I'm fond of chpst from runit.

If you're writing software to be run on completely arbitrary systems, and don't care about any of this, use whatever you personally prefer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1