14

Today I tried to switch to another shell.

First I tried fish, and used chsh -s fish to change fish to default. After some time I found it cannot use ~/.bashrc (&& needs to be replaced by and).

Because I prefer to reusing ~/.bashrc, I found zsh which seems an easier one and followed this documentation to switch to zsh.

While I was running sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)", suddenly it asked me to enter Password:. I entered the root password but got PAM: Authentication failure.

Then I tried chsh -s bash and chsh -s zsh, it always asked me for a password and threw PAM: Authentication failure (not system password). I can't figure this out.

  • Check if you have an alias or something with sudo in your .bashrc/.zshrc/.etcrc – Lucas Serafim Mar 1 at 12:10
27

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.

  • using sed: sudo sed s/required/sufficient/g -i /etc/pam.d/chsh – ospider Jan 15 at 2:28
  • Did unfortunately not work. But I commented that line out, changed the shell and removed the comment, again. So your hint was the right one for me. – Markus Zeller Jun 3 at 6:26
3
  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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.