Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc deprecate $sshd_conf_dir and hardcode /etc/ssh.



details:   https://anonhg.NetBSD.org/src/rev/e162e25332eb
branches:  trunk
changeset: 526242:e162e25332eb
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Apr 29 05:55:05 2002 +0000

description:
deprecate $sshd_conf_dir and hardcode /etc/ssh.
$sshd_conf_dir wasn't as flexible as liked (it didn't work for ssh(1),
host keys or known_hosts).

diffstat:

 etc/defaults/rc.conf |   3 +--
 etc/rc.d/sshd        |  32 ++++++++++++++------------------
 2 files changed, 15 insertions(+), 20 deletions(-)

diffs (92 lines):

diff -r 46007e09a1bb -r e162e25332eb etc/defaults/rc.conf
--- a/etc/defaults/rc.conf      Mon Apr 29 05:02:57 2002 +0000
+++ b/etc/defaults/rc.conf      Mon Apr 29 05:55:05 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: rc.conf,v 1.35 2002/04/10 23:37:12 martin Exp $
+#      $NetBSD: rc.conf,v 1.36 2002/04/29 05:55:05 lukem Exp $
 #
 # /etc/defaults/rc.conf --
 #      default configuration of /etc/rc.conf
@@ -149,7 +149,6 @@
 postfix=NO
 lpd=NO                 lpd_flags="-s"          # -s "secure" unix domain only
 sshd=NO                        sshd_flags=""
-                       sshd_conf_dir="/etc/ssh" # directory for sshd conf files
 
 # To run the named(8) DNS server as an unprivileged user under a
 # chroot(2) cage, uncomment the following after migrating the contents
diff -r 46007e09a1bb -r e162e25332eb etc/rc.d/sshd
--- a/etc/rc.d/sshd     Mon Apr 29 05:02:57 2002 +0000
+++ b/etc/rc.d/sshd     Mon Apr 29 05:55:05 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.16 2002/04/19 23:13:44 enami Exp $
+# $NetBSD: sshd,v 1.17 2002/04/29 05:55:06 lukem Exp $
 #
 
 # PROVIDE: sshd
@@ -11,50 +11,46 @@
 name="sshd"
 rcvar=$name
 command="/usr/sbin/${name}"
-command_args='-f ${sshd_conf_dir}/${name}.conf'
 pidfile="/var/run/${name}.pid"
-load_rc_config $name
-required_files="${sshd_conf_dir}/${name}.conf"
+required_files="/etc/ssh/${name}.conf"
 extra_commands="keygen reload"
 
 sshd_keygen()
 {
        (
        umask 022
-       if [ -f ${sshd_conf_dir}/ssh_host_key ]; then
+       if [ -f /etc/ssh/ssh_host_key ]; then
                echo "You already have an RSA host key" \
-                   "in ${sshd_conf_dir}/ssh_host_key"
+                   "in /etc/ssh/ssh_host_key"
                echo "Skipping protocol version 1 RSA Key Generation"
        else
                /usr/bin/ssh-keygen -t rsa1 -b 1024 \
-                   -f ${sshd_conf_dir}/ssh_host_key -N ''
+                   -f /etc/ssh/ssh_host_key -N ''
        fi
 
-       if [ -f ${sshd_conf_dir}/ssh_host_dsa_key ]; then
+       if [ -f /etc/ssh/ssh_host_dsa_key ]; then
                echo "You already have a DSA host key" \
-                   "in ${sshd_conf_dir}/ssh_host_dsa_key"
+                   "in /etc/ssh/ssh_host_dsa_key"
                echo "Skipping protocol version 2 DSA Key Generation"
        else
-               /usr/bin/ssh-keygen -t dsa \
-                   -f ${sshd_conf_dir}/ssh_host_dsa_key -N ''
+               /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
        fi
 
-       if [ -f ${sshd_conf_dir}/ssh_host_rsa_key ]; then
+       if [ -f /etc/ssh/ssh_host_rsa_key ]; then
                echo "You already have a RSA host key" \
-                   "in ${sshd_conf_dir}/ssh_host_rsa_key"
+                   "in /etc/ssh/ssh_host_rsa_key"
                echo "Skipping protocol version 2 RSA Key Generation"
        else
-               /usr/bin/ssh-keygen -t rsa \
-                   -f ${sshd_conf_dir}/ssh_host_rsa_key -N ''
+               /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
        fi
        )
 }
 
 sshd_precmd()
 {
-       if [ ! -f ${sshd_conf_dir}/ssh_host_key -o \
-           ! -f ${sshd_conf_dir}/ssh_host_dsa_key -o \
-           ! -f ${sshd_conf_dir}/ssh_host_rsa_key ]; then
+       if [ ! -f /etc/ssh/ssh_host_key -o \
+           ! -f /etc/ssh/ssh_host_dsa_key -o \
+           ! -f /etc/ssh/ssh_host_rsa_key ]; then
                run_rc_command keygen
        fi
 }



Home | Main Index | Thread Index | Old Index