chsh always asking a password , and get `PAM: Authentication failure`

Thanks to this question on Server Fault, I worked around this by:

Changing /etc/pam.d/chsh: from:

auth       required   pam_shells.so

to

auth       sufficient   pam_shells.so

Then it doesn't ask for a password anymore. But I think it better to restore chsh settings after switching the shell.


  1. Use which zshto find your zsh location.

    $ which zsh
    /usr/bin/zsh
    
  2. Add /usr/bin/zsh to /etc/shells

  3. Check in /etc/passwd that your config is /usr/bin/zsh

  4. Run chsh -s /usr/bin/zsh