Re: SSHD newbie question
On Thu, 22 Apr 1999, Rick Salvador wrote:
> I've compiled the sshd daemon successfully but I don't know how/where to
> set it up to startup when the system boots.
One easy way to handle it is to install the deb from non-free.debian.org,
that sets up everything for you.
> Im guessing that I put a Symbolic link to it in init.d and then have to
> call it from rc3.d but not real sure how to proceed.
You'd put a script something like the attached into /etc/init.d (This
particular one is installed by the .deb i mentioned), and then you'd
execute "update-rc.d ssh defaults"
Make sure you have the keys generated and everything else necessary to use
ssh.
#! /bin/sh
# /etc/init.d/ssh: start and stop the "secure shell(tm)" daemon
test -x /usr/sbin/sshd || exit 0
# Configurable options:
case "$1" in
start)
echo -n "Starting Secure Shell server: sshd"
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd
echo "."
;;
stop)
echo -n "Stopping Secure Shell server: sshd"
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd
echo "."
;;
reload|force-reload)
echo -n "Reloading Secure Shell server's configuration"
start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd
echo "."
;;
restart)
echo -n "Restarting Secure Shell server: sshd"
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd
start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd
echo "."
;;
*)
echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}"
exit 1
esac
exit 0
Reply to: