The Computer Oracle

How to change the Login Shell on Mac OS X from bash to zsh?

Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn

--

Track title: CC C Schuberts Piano Sonata No 13 D

--

Chapters
00:00 Question
00:36 Accepted answer (Score 117)
00:57 Answer 2 (Score 63)
02:18 Answer 3 (Score 12)
02:30 Answer 4 (Score 1)
02:57 Thank you

--

Full question
https://superuser.com/questions/362372/h...

Question links:
[it is possible in Mac OS X Leopard]: http://hints.macworld.com/article.php?st...

Answer 1 links:
[image]: https://i.stack.imgur.com/uF72p.png

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #shell

#avk47



ACCEPTED ANSWER

Score 121


You can change user shell by the following command:

chsh -s /bin/zsh

Note: To change it for a non-standard shell, make sure its path has been added to /etc/shells file.




ANSWER 2

Score 64


Funnily enough, the same method you link to in your question still works in OS X Lion through Sierra (10.12). The only difference: The preference pane is named Users & Groups instead of Accounts.

  1. Open "System Preferences" → "Users & Groups".
  2. Unless the lock icon is already unlocked, click the lock icon and authenticate yourself.
  3. Context-click on a user in the list of user names (hold down the Control key while clicking, or right-click on a right-handed two button mouse).
  4. In context menu, choose "Advanced Options…".
  5. Choose "Login shell" in the sheet that appears.

The note at the top of the "Advanced Options" screen claims you have to restart for the change to take effect, but you really just need to log out and back in again.

enter image description here




ANSWER 3

Score 13


Or:

sudo dscl . change /users/$USER UserShell /bin/bash $(which zsh)



ANSWER 4

Score 1


If anyone wondering same problem happens on macOS Sierra and following command allowed me to change shell without problems:

chpass -s /usr/local/bin/zsh