http://www.linuxgazette.com/issue78/lg_tips.html
2 cent tip: Make sure sshd is "always" there for you
Mon, 29 Apr 2002 19:16:33 -0700
James T. Dennis (The Answer Gang)
Make sure sshd is "always" there for you.
Using OpenSSH (circa 2.95 or later?) you can configure the
sshd to run
directly from your /etc/inittab under a "respawn" directive by
adding
the -D (don't detach) option like so:
# excerpt from /etc/inittab, near end
ss:12345:respawn:/usr/sbin/sshd -D
This will ensure that an ssh daemon process is always kept
running even
if the system experiences extreme conditions (such as OOM, out
of
memory, overcommitted memory) or a careless sysadmin's killall
which
kills the running daemon. So long as init can function it will
keep an
sshd running (just as it does with your existing getty
processes).
This is particularly handy for systems that are co-located and
which
don't have (reliable) serial port console connections. It just
might
save that drive across town or that frustrating, time consuming
and
embarassing call to the colo staff, etc.
Don Marti comments:
Run a second static, sashroot-only sshd this way and protect
yourself
from other trouble with your main sshd too.