sudo
command and Alice does not.
su
allows you to change users if you have the proper credentials.
su - alice
PS1="AllPowerful@RootlyPowers: > "
bash
whoami
id
id
provides more information than whoami
man
command
man command
id
id alice
id -G
id -uz
sudo
command.
sudo -i
id
and whoami
su - alice
sudo
sudo
further.
get the userid if the userid is not 0 ask for the password if the password is not correct log security volation exit Allow the user to become the desired new user.