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.4
11.1Slukem#!/bin/sh
21.1Slukem#
31.1Slukem
41.3Sjwise# PROVIDE: ssh
51.3Sjwise# REQUIRE: NETWORK
61.1Slukem
71.1Slukem. /etc/rc.subr
81.1Slukem
91.1Slukemname="sshd"
101.3Sjwisecommand="/usr/sbin/sshd"
111.3Sjwiserequired_files="/etc/sshd.conf"
121.1Slukem
131.3Sjwiseextra_commands="keygen"
141.3Sjwise
151.3Sjwisesshd_keygen() {
161.3Sjwise	if [ -f /etc/ssh_host_key ]
171.3Sjwise	then
181.3Sjwise		echo "You already have an RSA host key in /etc/ssh_host_key"
191.3Sjwise		echo "Skipping RSA Key Generation"
201.3Sjwise	else
211.3Sjwise		umask 022
221.3Sjwise		/usr/bin/ssh-keygen -b 1024 -f /etc/ssh_host_key -N ''
231.3Sjwise	fi
241.3Sjwise
251.3Sjwise	if [ -f /etc/ssh_host_dsa_key ]
261.3Sjwise	then
271.3Sjwise		echo "You already have a DSA host key in /etc/ssh_host_dsa_key"
281.4Sjlam		echo "Skipping DSA Key Generation"
291.3Sjwise	else
301.3Sjwise		umask 022
311.3Sjwise		/usr/bin/ssh-keygen -d -f /etc/ssh_host_dsa_key -N ''
321.3Sjwise	fi
331.3Sjwise}
341.3Sjwise
351.3Sjwisestart_precmd() {
361.3Sjwise	if [ ! -f /etc/ssh_host_key -o ! -f /etc/ssh_host_dsa_key ]
371.3Sjwise	then
381.3Sjwise		/etc/rc.d/sshd keygen
391.3Sjwise	fi
401.3Sjwise}
411.3Sjwise
421.3Sjwisekeygen_cmd=sshd_keygen
431.3Sjwisestart_precmd=start_precmd
441.3Sjwise
451.3Sjwiseload_rc_config $name
461.3Sjwiserun_rc_command "$1"
47

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