chsh: PAM authentication failed

Solution 1:

Check your /etc/shells file and add /bin/zsh to file if this line does not exists.

Solution 2:

Check your /etc/passwd. In my case I had specified an invalid shell with chsh previously and that's what was causing the problem.

I changed it from zsh as the shell to /bin/zsh and that made the problem go away for me.

Solution 3:

You must run your code as sudo:

sudo chsh -s /bin/zsh

I had same problem too, and it worked!

Solution 4:

I faced the same problem. whenever i typed in chsh it use to prompt

chsh: PAM authentication failed

But I solved it by doing some modification in the /etc/passwd file

Users of kali-linux

just open your root terminal and modify /etc/passwd file you can use pico,nano,or vi editor for this job i am going by vi

vi /etc/passwd

then search for the user account. and change the shells to your desired shell make sure the desired shell in installed in your distros of linux for new user to see what shells are present in their linux just type in

cat /etc/shells

it lists them there .If at all you have install the shell and you are unable to see it in /etc/shell you need to create a link and place path of shell say for suppose /bin/ksh in /etc/shells file manually...

for example you are in bash and you want to change it to ksh

just go to account in /etc/passwd file and in the last field edit

/bin/bash to /bin/ksh or /bin/ksh93 (as in your cat /etc/shells)

just logout and login and you are good to go...

for users of other distros (say) ubuntu

type in

sudo -H gnome-terminal (to get a root terminal)

and the process is same as above as you too have root terminal like a kali-linux user..