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

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.


There is a workaround for gnome-terminal:

  1. Go to EditProfile preferencesTitle and Command.
  2. Check Run a custom command instead of my shell.
  3. Provide bash as the Custom command (or fish, or anything).

If you are using LDAP authentication by PAM or something, you have to find your answer in your LDAP Server. Let's aim it for Microsoft AD, in which case your domain account is not in /etc/passwd when you log in, but you can see your user property in AD, by getent passwd | grep user.

If at the end it shows your shell is /bin/csh, that's because in your AD there is a attribute for that. So if you have administrator account on AD, you can fix it yourself. Otherwise just tell your AD admin to enable advance features in the View tab of Active directory users and computers > User properties > UNIX attributes. There you can change the login shell to /bin/bash.

Be sure you don't forget to run:

sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash

Source: User does not exist in /etc/passwd when trying to change the default shell.

Tags:

Passwd

Chsh