Shell

Polytropon freebsd at edvax.de
Tue Jun 30 15:18:51 UTC 2020


On Tue, 30 Jun 2020 07:58:31 -0700, Donald Wilde wrote:
> On 6/30/20, Polytropon <freebsd at edvax.de> wrote:
> > On Tue, 30 Jun 2020 06:33:44 -0700, Donald Wilde wrote:
> >> I would add only one suggestion here, and that would be to consider
> >> using bash-static and parking it in a place where it is available in
> >> the event of an excruciating mishap.
> >
> > This is usually where the "toor" user is interesting: It is
> > for interactive use, but in worst case, regular "root" will
> > always work as expected.
> 
> Yes, exactly. As one of my model train heroes once said, "In the event
> of excruciating pain..." and the sign on his layout pointed to a
> largish hammer. :)

In case of emergency, break glass.

And then?

No and then!

:-)



> [...]
> >> I haven't done this, but it should be possible to install both
> >> bash-static and bash. One would have to rename the first (bash-static)
> >> to something other than 'bash' and add that to the /etc/shells file,
> >> but after doing so also install the bash package with the
> >> non-monolithic binary 'bash' and use that as the shell for regular
> >> users.
> >
> > That is an even better approach. :-)
> 
> Excellent. Glad you think so, Polytropon!
> 
> For completeness, one would also want to alter the /etc/group file for
> the toor user, since it does not appear to be automatically created
> any more, at least in my 12-STABLE system.

Yes, while toor is in /etc/passwd, it's not in /etc/group.
Probably it never was, so that's something the sysadmin has
to add manually.

The real advantage of having the toor user as "interactive
root account" is that in the worst case, the unavailablility
of the desired dialog shell leads to a "login - logout", not
to a system panic during single-user mode startup.

In the past, aside from dealing with the static vs. dynamic
linking (and non-availability of said dynamic libraries),
non-OS shells could have resided on a partition other than
the root partition, but during single-user startup, only /
is mounted (and r/o), so whatever shell has been selected
_must_ be available on /, and run from there, simply because
/usr (and therefore /usr/local/bin and /usr/local/lib) could
be a different partition (!) that hasn't been mounted. With
today's "put everything on /" this is not a problem anymore,
though. :-)



> This way, our community has the benefit of the active development of
> BASH by the GPL guys and also supporting the folks like me who are
> surprised by TCSH behavior.

Luckily, there's choice (!) on FreeBSD so you can use whatever
shell suits your needs and preferences. Personally, while I
prefer the C shell's interactive behaviour over bash's, I use
bash for developing "one-liners" that tend to evolve into
bigger shell scripts, and being able to "use this for this,
use that for that" is definitely an advantage over "use this,
nothing else exists". :-)




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


More information about the freebsd-questions mailing list