Unix user without password still needs password

145 Views Asked by At

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?

1

There are 1 best solutions below

2
problemPotato On

When you run sudo su newuser, you are effectively running as "newuser". Running su as "newuser" will require escalating to root, requiring a password.

Try just exiting the the original su session with exit or <ctrl-d>. This should return you to the original shell.