Cross Reference: sshd
xref: /src/etc/rc.d/sshd
  • Home
  • History
  • AnnotateAnnotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /src/etc/rc.d/
sshd revision 1.6
11.1Slukem#!/bin/sh
21.1Slukem#
31.6Slukem# $NetBSD: sshd,v 1.6 2000/08/10 01:41:09 lukem Exp $
41.5Sjwise#
51.1Slukem
61.6Slukem# PROVIDE: sshd
71.6Slukem# REQUIRE: LOGIN
81.1Slukem
91.1Slukem. /etc/rc.subr
101.1Slukem
111.1Slukemname="sshd"
121.6Slukemcommand="/usr/sbin/${name}"
131.1Slukem
141.6Slukemrequired_files="/etc/${name}.conf"
151.3Sjwiseextra_commands="keygen"
161.3Sjwise
171.6Slukemsshd_keygen()
181.6Slukem{
191.6Slukem	if [ -f /etc/ssh_host_key ]; then
201.3Sjwise		echo "You already have an RSA host key in /etc/ssh_host_key"
211.3Sjwise		echo "Skipping RSA Key Generation"
221.3Sjwise	else
231.3Sjwise		umask 022
241.3Sjwise		/usr/bin/ssh-keygen -b 1024 -f /etc/ssh_host_key -N ''
251.3Sjwise	fi
261.3Sjwise
271.6Slukem	if [ -f /etc/ssh_host_dsa_key ]; then
281.3Sjwise		echo "You already have a DSA host key in /etc/ssh_host_dsa_key"
291.4Sjlam		echo "Skipping DSA Key Generation"
301.3Sjwise	else
311.3Sjwise		umask 022
321.3Sjwise		/usr/bin/ssh-keygen -d -f /etc/ssh_host_dsa_key -N ''
331.3Sjwise	fi
341.3Sjwise}
351.3Sjwise
361.6Slukemsshd_precmd()
371.6Slukem{
381.6Slukem	if [ ! -f /etc/ssh_host_key -o ! -f /etc/ssh_host_dsa_key ]; then
391.3Sjwise		/etc/rc.d/sshd keygen
401.3Sjwise	fi
411.3Sjwise}
421.3Sjwise
431.3Sjwisekeygen_cmd=sshd_keygen
441.5Sjwisestart_precmd=sshd_precmd
451.3Sjwise
461.3Sjwiseload_rc_config $name
471.3Sjwiserun_rc_command "$1"
48

Indexes created Mon Nov 10 17:20:41 GMT 2025