I created a user on OS X Mavericks – dscl . -create /Users/newuser UserShell /bin/sh – without setting any password. This is confirmed by reading the user file with the dscl interactive prompt.
However, when I sudo su newuser and try to su back to root, bash prompts me for a password. I need to close the terminal and open a new window to exit the user session.
Why is that?
When you run
sudo su newuser, you are effectively running as "newuser". Runningsuas "newuser" will require escalating to root, requiring a password.Try just exiting the the original
susession withexitor<ctrl-d>. This should return you to the original shell.