News for hackers. Stuff that matters.
Re:Is Sudo Almost Useless? by dheera on Tuesday June 09, 2020 @03:23PM (#23469878)
> I always considered it an administrative tool to differentiate between authorized users and administrators.

For that you could just do

    alias sudo=su -c
if you want the admin (root) password to be different from the user (authorized users) password.

I suppose the main advantage of sudo is it gives you more granular control over which commands are allowed and which aren't. For example if you're building a robot, you can allow the robot's process access to /sbin/shutdown to be able to restart the system on remote command (or lack of remote command).

Re:Is Sudo Almost Useless? by dependenttypes on Tuesday June 09, 2020 @03:43PM (#23470073)
> alias sudo=su -c

This will not work. sudo cp aaa bbb will work but su -c cp aaa bbb will complain that the user aaa does not exist, you need to quote them instead, like su -c "cp aaa bbb".

It would make more sense to make it a script

    #!/bin/sh
    su -c "$@"
Re:Is Sudo Almost Useless? by jabirali on Tuesday June 09, 2020 @05:25PM (#23471078)
Or make it a shell function that operates on $@ in the same way, so you can put it in your bashrc with your aliases.
Re:Is Sudo Almost Useless? by dheera on Tuesday June 09, 2020 @06:21PM (#23471607)
I tried this but didn't work:

    ~ :) gudo () { su -c "$@"; }
    ~ :) gudo echo foo bar
    su: user foo does not exist
Re:Is Sudo Almost Useless? by jabirali on Wednesday June 10, 2020 @02:44AM (#23474600)
I searched it up, and apparently "$@" and expands to "foo" "bar" while "$*" expands to "foo bar", and the latter is what we want. From a quick test on my machine, that replacement in in your function definition seems to fix it :).
Re:Is Sudo Almost Useless? by TecoAndJix on Tuesday June 09, 2020 @09:02PM (#23472746)
This site is good to check out when evaluating specific Sudo permissions for users - https://gtfobins.github.io/