Ubuntu – user does not exist in /etc/passwd when trying to change the default shell

chshpasswd

I want to change my default shell from tcsh to bash. So I tried and this is what happened:

>sudo chsh userid
Changing the login shell for userid
Enter the new value, or press ENTER for the default
        Login Shell [/xhbin/tcsh]: /bin/bash
chsh: user 'userid' does not exist in /etc/passwd

Indeed, I am not in /etc/passwd. I don't know why.

What can I do?

Best Answer

My computer is part of a network using using distributed authentication so my user details would not appear in the local /etc/passwd file (but are visible using getent passwd userid). (thanks @steeldriver) In my case I had to do chsh on a core machine.