While trouble-shooting, you should establish a root login, in a separate window, in case you need to use it to recover.
The missing shell defaults to
/bin/sh
. It's normal for the "toor" account (Bourne shell for root), and is not an issue.
Above, you are only looking at /etc/passwd. You need to have a look at /etc/master.passwd as well, and tell us what you see, especially around line 3 (usually the entry for root).
To examine and re-generate the password files:
Code:
sudo cp -p /etc/master.passwd /etc/master.passwd.save
sudo vipw
:set list
The ":set list" will make non-printable characters visible, and place a dollar sign at the end of each line (indicating the presence of the newline character).
Double check the syntax and content of line 3.
Any appearance of caret "^" indicates a problem character follows. If you see that, fix it.
Make sure that the shell for your account is what you want, and that its full path name appears in /etc/shells.
Then make a trivial change, like adding a space to a comment in line 1 or 2, and "wq!"
Your password files should all be re-generated.