How do I change a users default shell in OSX?
for <=10.4 - netinfo manager, /users/whoever/shell
for >=10.5
- Go to System Preferences -> Accounts
- Click the lock icon to unlock the preference pane
- Right-click (or control-click) on user and select "advanced options"
- Edit login shell field
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.
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.