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).
webmaster :: Sep.25.2014 :: System, Terminal :: 3 Comments »
3 Responses to “Changing your default shell in Mac OS X 10.9 (Mavericks)”
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
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.
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.