Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to set ZSH as my default shell, however it keeps reverting back to bash.

I have tried this code:

sudo chsh -s $(which zsh)

I've also tried:

sudo chsh -s /bin/zsh 

Also tried these commands without sudo. Any ideas on what else I need to do. When running ZSH from within bash it loads up and works fine but I'd like to set it as the default shell.

share|improve this question

3 Answers 3

up vote 17 down vote accepted

If you use sudo it will change the shell not for your working user but for root. Just using

chsh -s /bin/zsh

without sudo should work (but you need to login again to see the change).

share|improve this answer
3  
I have the same problem and the answer doesn't solve it –  Aswin Murugesh Jul 21 '13 at 16:11

If zsh is not /bin/zsh then chsh won't work. On Ubuntu it is /usr/bin/zsh. so doing chsh -s /usr/bin/zsh or chsh -s `which zsh` should work. Also need to re-login to desktop session.

share|improve this answer

Strange, the "accepted" answer didn't work for me as I got

chsh: PAM: Authentication failure

To solve this issue edit your /etc/passwd and make sure it points to the zsh location. (You can find this by running "which zsh") In my case my user called "webmaster" looked like this: enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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