Alice has sudo rights. Bob does not (this is not changeable), but does know the password to Alice's account.
If Bob wants to perform administrative commands he must:
- fill in Alice's password for su
- fill in Alice's sudo password
- command gets executed with super user rights
To shorten this I use:
su -m alice -c 'sudo whoami'.
However, I want to build an alias command that replaces with this tedious command with just the regular sudo command.
So I made this:
alias sudo="su -m alice -c 'sudo $@'".
- It doesn't work
- It always asks for Alice's su password, the sudo password it does remember
How can I do this better?