Rebuilding FreeBSD!

Polytropon freebsd at edvax.de
Thu Dec 31 13:27:44 UTC 2015


On Thu, 31 Dec 2015 02:36:03 -0800, David Benfell wrote:
> On 12/30/2015 10:06 PM, Bertram Scharpf wrote:
> > Not actually a different shell. Just install another one from 
> > ports/packages. To avoid disappointments I recommend to leave csh or 
> > sh in /etc/passwd at least for root.
> Having used zsh for well over a decade in both Linux and BSD systems, I 
> have never found it necessary to leave csh or sh or bash as the root 
> shell.

This advice is still valid due to the following reasons:

When users install additional shells, they usually go to
the /usr/local subtree. When the user also has partitioned
the disk so that /usr is a partition different from /, then
/usr/local/bin/* won't be available in single-user mode. If
the default shell points to a program in that location - well,
problem. However, many shells support being installed into
/bin (even though this is a slight interference with the OS),
and most also support being built statically, so no 3rd party
libraries in /usr/local/lib will be required.

A non-existing shell will not permit a login. For the root
user, which is the only one where you always want to be sure
it can log in, having a shell that _might_ not be available
is a bad idea. For regular users it's okay, as they usually
do not log in in case of an emergency - and "emergency" often
means a state of heavily reduced system functionality (only
console login, no X, maybe no network, single-user mode, no
daemons running, worst case).

Furthermore, it's often advised not to do interactive work
as the "root" user. A configurable UID 0 account is provided
with the "toor" user which can easily have a custom shell.
This makes sure emergency operations aren't made complicated.
For everything else, there's always su, sudo, and super,
with varying degrees of permissions and shell environment
inheritance.



> Scripts all have their own #! line so they'll use the shell 
> they're written for (pretty much always sh in FreeBSD ports and the base 
> system as far as I know).

This is correct. That's why removing /bin/sh (which is, by the
way, also the default dialog shell in single-user mode!) is a
bad idea.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list