When running commands as other users from the command line, what is recommended best practice? In the past I've used sudo like so:
sudo -u username command [args]
I've been told (with no specific reasons why) that using sudo for this purpose is wrong. I'd like to know why. Is there some "best way" to accomplish this? For example, I've also used the su command like so:
su username - -c "command [args]"
I can't imagine why either of these methods would be "bad". Your thoughts?