Why does the root shell use tsch
but under "Add Users" it defaults to csh
for new users? Is this to differentiate the root console? I am unsure I have the right shells stated there either. I know root default shell is different than new users default shell.
Not a big deal and I know I can choose whatever shell I want. I just wonder why not consistent. Is this by design?
The real answer may be lost in the mists of time. Digging back into history, 3BSD in early 1980 has
/bin/sh for root, but 4BSD in late 1980 has
/bin/csh; but I can't be certain that those sources might not have been modified post-release/distribution, and could reflect a personal choice of someone. FreeBSD's root (in recent releases, at least) defaults to
/bin/csh, but toor uses
/bin/sh (which is the system default shell).
The final 4.4BSD from CSRG, pre-Deathstar-settlement, has root on
/bin/csh and toor on
/bin/sh, in an
/etc/passwd dated 1994.
In general, it shouldn't really matter which shell is configured for root, as all of the system scripts should run using an explicit choice of shell (typically through the shebang at the top of the script), and most things should not depend on the root user's environment. That said, I don't recommend changing it, and it certainly must not be changed to something which does not exist in the base system (i.e. root should never have a shell from ports, or a shell which links to dynamic libraries from ports); mostly so that the shell doesn't break (i.e. so you can still login as root when the all of the ports have gone wrong, or similar), but it's also a slightly increased security risk. If
/usr is a separate filesystem, root should not even have a shell from
/usr/bin; its shell should always come from the root filesystem (i.e.
/bin or
/sbin).
The unique situation with root means that it needs to work with not just what is on the system today, but also with whatever the OS vendor might push out tomorrow. While it should be unlikely to conflict, the safe course of action is not to change it, and there mostly isn't a good reason to change it. As a general principle, I never ever change root's shell from the system default, and I have never permitted anyone else to change it on systems where I have that level of authority; instead I just
exec my-favourite-shell
after login/su/sudo.