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:
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
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).