Solved su no longer works after creating new user

Hey everyone, I created a new user a while ago, let's call it newuser. I created it as described in the handbook. su stopped working for my regular user afterwards, with the following error message:

su: newuser: No such file or directory

Since then I have deleted newuser, but the error persists. doas and sudo still work fine, it's just su. Some services fail during boot with the exact same error message, tor for example. Sorry for not providing much more info but I have no idea where to start with this one.
 
How exactly You add the new user: adduser, vipw or maybe anything else?
The su command can only be used by a user if that user is a member of the wheel group.
What says the output of the groups command?
 
Regenerate the password databases:
Code:
/usr/sbin/pwd_mkdb -p /etc/master.passwd

pwd_mkdb: warning, unknown root shell. Exits with 0. Error persists.


How exactly You add the new user: adduser, vipw or maybe anything else?
The su command can only be used by a user if that user is a member of the wheel group.
What says the output of the groups command?

I used adduser for adding the new user. My regular user is a member of wheel, video and operator. It worked before adding the new user, you see.


New info: Turns out I can't even login as root from a tty:

login: newuser: No such file or directory

This is 13.0-RELEASE-p4, by the way.
 
Stay logged in as root... where ever that is...
Take a copy of /etc/master.passwd immediately.
Look at it to see if it seems plausible (unknown root shell is a worry).
If it looks OK, change root's shell back to /bin/csh. Try vipw(8). If that won't work, edit /etc/master.passwd directly.
The immediately repeat /usr/sbin/pwd_mkdb -p /etc/master.passwd
If all that fails, start again with a copy of /etc/master.passwd off the release media.
 
Some basic sanity tests, as root. Check line counts, and root shell:
Code:
[sherman.130] # wc -l /etc/master.passwd /etc/passwd   
      42 /etc/master.passwd
      42 /etc/passwd
      84 total
[sherman.131] # grep "^root" /etc/master.passwd /etc/passwd   
/etc/master.passwd:root:$6$Eex4KlLJdbmHzImU$WtZodLXaGp5VgcmEhlB79ZbY9KsMqJxSPn351hbJ6ufXlxCRv78pRWr3lkSOssQOfsvFSwzlDLmJ5c3gU69Z50:0:0::0:0:Charlie &:/root:/bin/csh
/etc/passwd:root:*:0:0:Charlie &:/root:/bin/csh
 
Bingo. Charlie's login shell is "newuser". I must've typed in a wrong command when changing newuser's login shell and changed root's shell to "newuser" instead. Feeling kinda dumb now. Case closed.
 
Back
Top