diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-09-28 07:20:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-09-28 07:20:02 +0000 |
commit | e1b9aa8bb6a2a92a9ade04b17d6d13c92c23f1e6 (patch) | |
tree | d6f8feaa1c4373339717bcae6ed808ab932eab49 /etc | |
parent | e687695fb2375cf9b14e3507352db3fec8f5ca1f (diff) |
start ssh as part of base system; if no host key, build it upon boot
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.113 1999/09/27 23:41:18 deraadt Exp $ +# $OpenBSD: rc,v 1.114 1999/09/28 07:20:01 deraadt Exp $ # System startup script run by init on autoboot # or after single-user. @@ -375,6 +375,16 @@ if [ -f /var/account/acct ]; then echo 'turning on accounting'; accton /var/account/acct fi +if [ ! -f /etc/ssh_host_key ]; then + umask 022 + echo -n "ssh-keygen: generating new host key... " + if /usr/bin/ssh-keygen -q -b 1024 -f /etc/ssh_host_key -N ''; then + echo done. + else + echo failed. + fi +fi + echo -n starting network daemons: # $gated and $routed_flags are imported from /etc/rc.conf. @@ -468,6 +478,11 @@ if [ "X${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then echo -n ' mopd'; mopd ${mopd_flags} fi +if [ X"${sshd}" == X"YES" -a -x /usr/sbin/sshd ]; then + echo -n ' sshd'; /usr/sbin/sshd + #echo -n ' sshd2022'; /usr/sbin/sshd -p 2022 +fi + if [ -x /usr/sbin/screenblank ]; then echo -n ' screenblank'; /usr/sbin/screenblank fi |