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.8
11.1Slukem#!/bin/sh
21.1Slukem#
31.8Slukem# $NetBSD: sshd,v 1.8 2000/09/19 13:04:39 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.8Slukemrcvar=$name
131.6Slukemcommand="/usr/sbin/${name}"
141.7Slukempidfile="/var/run/${name}.pid"
151.6Slukemrequired_files="/etc/${name}.conf"
161.7Slukemextra_commands="keygen reload"
171.3Sjwise
181.6Slukemsshd_keygen()
191.6Slukem{
201.6Slukem	if [ -f /etc/ssh_host_key ]; then
211.3Sjwise		echo "You already have an RSA host key in /etc/ssh_host_key"
221.3Sjwise		echo "Skipping RSA Key Generation"
231.3Sjwise	else
241.3Sjwise		umask 022
251.3Sjwise		/usr/bin/ssh-keygen -b 1024 -f /etc/ssh_host_key -N ''
261.3Sjwise	fi
271.3Sjwise
281.6Slukem	if [ -f /etc/ssh_host_dsa_key ]; then
291.3Sjwise		echo "You already have a DSA host key in /etc/ssh_host_dsa_key"
301.4Sjlam		echo "Skipping DSA Key Generation"
311.3Sjwise	else
321.3Sjwise		umask 022
331.3Sjwise		/usr/bin/ssh-keygen -d -f /etc/ssh_host_dsa_key -N ''
341.3Sjwise	fi
351.3Sjwise}
361.3Sjwise
371.6Slukemsshd_precmd()
381.6Slukem{
391.6Slukem	if [ ! -f /etc/ssh_host_key -o ! -f /etc/ssh_host_dsa_key ]; then
401.3Sjwise		/etc/rc.d/sshd keygen
411.3Sjwise	fi
421.3Sjwise}
431.3Sjwise
441.3Sjwisekeygen_cmd=sshd_keygen
451.5Sjwisestart_precmd=sshd_precmd
461.3Sjwise
471.3Sjwiseload_rc_config $name
481.3Sjwiserun_rc_command "$1"
49

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