I know the security risks, but I am performing this experiment/excercise on an old, seldom used *nix machine I have laying around the house. So doing this excerise will not bring any security risk to my machine. Having said that, please do not post any comments regarding security.
I also know I can change sudoers to disable password prompts, but I am not interested in that.
I have found a command:
echo "password" | sudo -S su
but which works very oddly. I type it in, and the domain stays the same; I don't change into root. Is there something else I'm missing or is there a better way to do this?
Things I've done:
- added a
\nto the end of the password: password doesn't verify correctly.
- ommitting the
su: prints out usage on how to use sudo correctly