Posts RSS Comments RSS 48 Posts and 155 Comments till now

Changing your default shell in Mac OS X 10.9 (Mavericks)

With the “Shellshock” vulnerability out in the wild and Macs defaulting to the Bash shell it seems a good precaution to change default shells until Apple patches the current implementation of Bash. Note that this technique also works in earlier versions of OS X.

To change shells in Terminal do the following:

Open Terminal

Type chsh -s /path/to/shell

The various shell paths are:

zsh – /bin/zsh
tcsh – /bin/tcsh
ksh – /bin/ksh
bash – /bin/bash
sh – /bin/sh

So, to change to the tcsh shell enter chsh -s /bin/tcsh

Enter your admin password when prompted and you’re done.
To check if the change took enter echo $SHELL
You should get the same path you just entered in the previous command. Once Apple patches the issue you can go back to Bash using the same technique.

If you want to wrap this in an AppleScript or add it to an Automater action for wider distribution just use do shell script . For example, to change to tcsh using AppleScript use the following:

do shell script “chsh -s /bin/tcsh” with administrator privileges

This will prompt for the users password (assuming they are an admin).

Be Sociable, Share!

3 Responses to “Changing your default shell in Mac OS X 10.9 (Mavericks)”

  1. on 25 Sep 2014 at 11:17 amA user

    Not possible. The terminal responds non-standard shell. If you try despite it responds cash: no changes made. If you echo you still get the reply /bin/bash

    No other shells for my Mac available, or what?

    Maveriks 10.9.2

  2. on 25 Sep 2014 at 12:09 pmwebmaster

    Have you checked your spelling on the command? It’s worked fine for 2 10.9.5 machines for me. There are several shells available on OS X at the locations listed. Try quitting Terminal, reopening it and running the echo command again.

  3. on 26 Sep 2014 at 8:42 amA user

    Yeah, you are right. After reopening it now, today, I see that the change took place. It works even that I don’t know, what a shell is. Thanks from Germany, unknown friend, and I hope that this helps in some way, and greet me the NSA. 😉 We, at least some people of my country know, that a lot of you folks, or at least some people of the USA do not agree with the ways some things are going on now.

Trackback this post | Feed on Comments to this post

Leave a Reply