MacOS – Why Doesn’t OSX root user automatically default to the same shell as other users

macosroot

Why doesn't the root user on OSX automatically default to the same shell as other users?

Seems like this would avoid a lot of complications, but I guess there must be complications with the shells being the same for root as others, but I just don't know what they are. I have googled this and searched Stack Exchange, and have not found an explanation for it.

Best Answer

On my system (OS X 10.10 Yosemite), root is configured to use a /bin/sh shell by default (in both /etc/passwd and through OpenDirectory). Other users (aside from daemons) are configured to use /bin/bash by default.

There is no significant difference between the two in everyday usage, although Bash has had some high profile security issues lately (reference: ShellShock and the Apple security patch at https://support.apple.com/en-us/HT201393). Maybe Apple made the choice to set root's default shell to /bin/sh by default, in light of that?