Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct OSX way of changing a users default shell? When I googled for it I found several references to an application called NetInfo Manager but I couldn't find it on my system. There were also references to a command line version called niutil which I didn't find either.

share|improve this question

migrated from Jan 18 '12 at 9:00

This question came from our site for system and network administrators.

possible duplicate of How do I set my shell in Mac OS X? – Daniel Beck Jan 18 '12 at 9:22
up vote 44 down vote accepted

for <=10.4 - netinfo manager, /users/whoever/shell

for 10.5=> - SysPrefs, accounts, right-click (or control-click) on user, select advanced options, edit login shell field.

share|improve this answer
Wow, after 8 years of using OS X I didn't know about control clicking in the users prefs: I guess this was added in 10.5 though as you pointed out. +1 – jkp Nov 13 '10 at 16:03
Control-Click is stunnning! – Eonil Feb 24 '11 at 2:01
Lifesaver after moving my account's shell out of the PATH... couldn't start Terminal to fix via command line! – davemyron Oct 31 '12 at 7:58
sudo chsh -s /path/to/shell username

where shell is the one you want for that user. sudo is not needed if you know username's password.

man chsh

for more examples.

share|improve this answer
+1 for treating OS X like a normal *nix system. – Telemachus Jun 7 '09 at 14:11
works too for root for su, which isn't visible in control panel. I think? – Chris F Carroll Mar 19 '13 at 15:55
You can also run just chsh and change the shell field. If you get an error like chsh: /usr/local/bin/bash: non-standard shell, add /usr/local/bin/bash to /etc/shells. – user495470 Mar 19 '13 at 19:15
Maybe something changed in 10.9, but this command now throws a usage message. It seems the correct syntax is now chsh -s /path/to/shell username – Hypermattt Jan 24 '14 at 23:17

NetInfo has been replaced by Directory Services (dscl) and it can be noted the default shell for Mac OS X since 10.3 has been bash. Prior to that it was tcsh.

If you need to do this from the command line (eg. for pushing via ARD or remotely via SSH) you can run:

sudo dscl localhost -change /Local/Default/Users/USERNAME shell OLD_SHELL NEW_SHELL
#In Use:
sudo dscl localhost -change /Local/Default/Users/chealion shell /bin/bash /bin/zsh

If you're not sure of the current shell you can run:

sudo dscl localhost -read /Local/Default/Users/USERNAME shell

If the user is not a local user the path will simply change and if necessary you would change localhost to the name of your Open Directory Server. (Assuming it runs 10.5).

The info is stored in .plists (xml) in /private/var/db/dslocal/ - you don't want to edit the plist files by hand however.

share|improve this answer

For 10.10:

not shell but UserShell:

sudo dscl localhost -change /Local/Default/Users/USERNAME UserShell /bin/bash /bin/ksh
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .