I'm trying to suid a shell and it's not working. I need help understanding why, and how to fix it...
I'm following these steps (as root)
cp /usr/bin/bash /usr/bin/bash-emergency
chmod 4755 /usr/bin/bash-emergency
bash-emergency is owned by root:root
I would expect that this should execute bash-emergency as root, resulting in a root shell
I know all the reasons not to do this. This is in a lab. su and sudo, for the sake of this test, are not an option. I need a user to be able to get a root shell without having to authenticate or otherwise be challenged after their initial login.
I'm hoping to be able to do this with a simple suid executable rather than changing the non-root user's UID to 0.
What am I doing wrong?