diff options
| author | lukem <lukem@NetBSD.org> | 2002-04-29 08:23:34 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 2002-04-29 08:23:34 +0000 |
| commit | 244b762de14b59cd50f701a0b7cb7de6d4ed9f66 (patch) | |
| tree | 6e98f830b28a29e920c43db17ede36b523412469 | |
| parent | 21d59649a50e7e1536122e42c50bc3f5a015c7c2 (diff) | |
Complete the conversion back to the OpenSSH default configuration files of
"/etc/ssh/ssh_config" (from "/etc/ssh/ssh.conf") for ssh(1) and other
userland tools, and "/etc/ssh/sshd_config (from "/etc/ssh/sshd.conf")
for sshd(8).
etc/postinstall will detect this, and if "fix" is given, rename the files.
| -rw-r--r-- | crypto/dist/ssh/pathnames.h | 6 | ||||
| -rw-r--r-- | crypto/dist/ssh/ssh.1 | 10 | ||||
| -rw-r--r-- | crypto/dist/ssh/sshd.8 | 8 | ||||
| -rw-r--r-- | distrib/sets/lists/etc/mi | 6 | ||||
| -rw-r--r-- | etc/mtree/special | 6 | ||||
| -rwxr-xr-x | etc/postinstall | 81 | ||||
| -rwxr-xr-x | etc/rc.d/sshd | 4 | ||||
| -rw-r--r-- | usr.bin/ssh/Makefile | 6 |
8 files changed, 79 insertions, 48 deletions
diff --git a/crypto/dist/ssh/pathnames.h b/crypto/dist/ssh/pathnames.h index e85c848d87a..191649861e6 100644 --- a/crypto/dist/ssh/pathnames.h +++ b/crypto/dist/ssh/pathnames.h @@ -1,4 +1,4 @@ -/* $NetBSD: pathnames.h,v 1.10 2002/04/22 07:59:41 itojun Exp $ */ +/* $NetBSD: pathnames.h,v 1.11 2002/04/29 08:23:35 lukem Exp $ */ /* $OpenBSD: pathnames.h,v 1.12 2002/03/19 03:03:43 stevesk Exp $ */ /* @@ -29,8 +29,8 @@ * Of these, ssh_host_key must be readable only by root, whereas ssh_config * should be world-readable. */ -#define _PATH_SERVER_CONFIG_FILE SSHDIR "/sshd.conf" -#define _PATH_HOST_CONFIG_FILE SSHDIR "/ssh.conf" +#define _PATH_SERVER_CONFIG_FILE SSHDIR "/sshd_config" +#define _PATH_HOST_CONFIG_FILE SSHDIR "/ssh_config" #define _PATH_HOST_KEY_FILE SSHDIR "/ssh_host_key" #define _PATH_HOST_DSA_KEY_FILE SSHDIR "/ssh_host_dsa_key" #define _PATH_HOST_RSA_KEY_FILE SSHDIR "/ssh_host_rsa_key" diff --git a/crypto/dist/ssh/ssh.1 b/crypto/dist/ssh/ssh.1 index f0db02c91f7..d7f60845895 100644 --- a/crypto/dist/ssh/ssh.1 +++ b/crypto/dist/ssh/ssh.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: ssh.1,v 1.19 2002/04/22 07:59:46 itojun Exp $ +.\" $NetBSD: ssh.1,v 1.20 2002/04/29 08:23:35 lukem Exp $ .\" -*- nroff -*- .\" .\" Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -580,7 +580,7 @@ option below. Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file -.Pq Pa /etc/ssh/ssh.conf +.Pq Pa /etc/ssh/ssh_config will be ignored. The default for the per-user configuration file is .Pa $HOME/.ssh/config . @@ -655,7 +655,7 @@ the following order: command line options, user's configuration file .Pq Pa $HOME/.ssh/config , and system-wide configuration file -.Pq Pa /etc/ssh/ssh.conf . +.Pq Pa /etc/ssh/ssh_config . For each parameter, the first obtained value will be used. The configuration files contain sections bracketed by @@ -1399,7 +1399,7 @@ to verify the client host when logging in; other names are needed because does not convert the user-supplied name to a canonical name before checking the key, because someone with access to the name servers would then be able to fool host authentication. -.It Pa /etc/ssh/ssh.conf +.It Pa /etc/ssh/ssh_config Systemwide configuration file. This file provides defaults for those values that are not specified in the user's configuration file, and @@ -1504,7 +1504,7 @@ If you have in .Pa $HOME/.ssh/config or -.Pa /etc/ssh.conf , +.Pa /etc/ssh_config , you will need to change this (e.g. to .Dq Cm Cipher No 3des ) . Also, if you have private keys encrypted with IDEA, you will need to diff --git a/crypto/dist/ssh/sshd.8 b/crypto/dist/ssh/sshd.8 index 7cfd683a92b..b95085f2af0 100644 --- a/crypto/dist/ssh/sshd.8 +++ b/crypto/dist/ssh/sshd.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: sshd.8,v 1.24 2002/04/22 07:59:48 itojun Exp $ +.\" $NetBSD: sshd.8,v 1.25 2002/04/29 08:23:35 lukem Exp $ .\" -*- nroff -*- .\" .\" Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -199,7 +199,7 @@ will send the output to the standard error instead of the system log. .It Fl f Ar configuration_file Specifies the name of the configuration file. The default is -.Pa /etc/ssh/sshd.conf . +.Pa /etc/ssh/sshd_config . .Nm refuses to start if there is no configuration file. .It Fl g Ar login_grace_time @@ -317,7 +317,7 @@ to use IPv6 addresses only. .Sh CONFIGURATION FILE .Nm reads configuration data from -.Pa /etc/ssh/sshd.conf +.Pa /etc/ssh/sshd_config (or the file specified with .Fl f on the command line). @@ -1177,7 +1177,7 @@ cvs.openbsd.org,199.185.137.3 ssh-rsa AAAA1234.....= .Ed .Sh FILES .Bl -tag -width Ds -.It Pa /etc/ssh/sshd.conf +.It Pa /etc/ssh/sshd_config Contains configuration data for .Nm sshd . This file should be writable by root only, but it is recommended diff --git a/distrib/sets/lists/etc/mi b/distrib/sets/lists/etc/mi index cfe7ec19eb6..9ca42987364 100644 --- a/distrib/sets/lists/etc/mi +++ b/distrib/sets/lists/etc/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.96 2002/04/26 15:46:13 lukem Exp $ +# $NetBSD: mi,v 1.97 2002/04/29 08:23:36 lukem Exp $ ./.cshrc etc-util-etc ./.profile etc-util-etc ./dev/MAKEDEV.local etc-sys-etc @@ -173,8 +173,8 @@ ./etc/skel/.rhosts etc-sys-etc ./etc/skeykeys etc-sys-etc ./etc/spwd.db etc-sys-etc -./etc/ssh/ssh.conf etc-secsh-etc -./etc/ssh/sshd.conf etc-secsh-etc +./etc/ssh/ssh_config etc-secsh-etc +./etc/ssh/sshd_config etc-secsh-etc ./etc/sysctl.conf etc-sys-etc ./etc/syslog.conf etc-sys-etc ./etc/ttys etc-sys-etc diff --git a/etc/mtree/special b/etc/mtree/special index 700b4591f84..407759ce1e9 100644 --- a/etc/mtree/special +++ b/etc/mtree/special @@ -1,4 +1,4 @@ -# $NetBSD: special,v 1.56 2002/04/29 07:28:27 lukem Exp $ +# $NetBSD: special,v 1.57 2002/04/29 08:23:35 lukem Exp $ # @(#)special 8.2 (Berkeley) 1/23/94 # # Hand-crafted mtree specification for the dangerous files. @@ -224,7 +224,7 @@ ./etc/shosts.equiv type=file mode=0600 optional ./etc/spwd.db type=file mode=0600 tags=exclude ./etc/ssh type=dir mode=0755 optional -./etc/ssh/ssh.conf type=file mode=0644 optional +./etc/ssh/ssh_config type=file mode=0644 optional ./etc/ssh/ssh_host_dsa_key type=file mode=0600 optional tags=nodiff ./etc/ssh/ssh_host_dsa_key.pub type=file mode=0644 optional ./etc/ssh/ssh_host_key type=file mode=0600 optional tags=nodiff @@ -233,7 +233,7 @@ ./etc/ssh/ssh_host_rsa_key.pub type=file mode=0644 optional ./etc/ssh/ssh_known_hosts type=file mode=0644 optional ./etc/ssh/ssh_known_hosts2 type=file mode=0644 optional -./etc/ssh/sshd.conf type=file mode=0644 optional +./etc/ssh/sshd_config type=file mode=0644 optional ./etc/sysctl.conf type=file mode=0644 ./etc/syslog.conf type=file mode=0644 ./etc/ttyaction type=file mode=0644 optional diff --git a/etc/postinstall b/etc/postinstall index 9e5ff98b99d..902114347bb 100755 --- a/etc/postinstall +++ b/etc/postinstall @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: postinstall,v 1.5 2002/04/29 06:05:24 lukem Exp $ +# $NetBSD: postinstall,v 1.6 2002/04/29 08:23:35 lukem Exp $ # # Copyright (c) 2002 The NetBSD Foundation, Inc. # All rights reserved. @@ -164,6 +164,31 @@ rcconf_isset() ) } +# move_file op src dest -- +# check (op == "check") or move (op != "check") from src to dest. +# returns 0 if ok, 1 otherwise. +# +move_file() +{ + [ $# -eq 3 ] || err 2 "USAGE: move_file op src dest" + _fm_op=$1 + _fm_src=$2 + _fm_dest=$3 + + if [ -f "${_fm_src}" -a ! -f "${_fm_dest}" ]; then + if [ "${_fm_op}" = "check" ]; then + msg "Move ${_fm_src} to ${_fm_dest}" + return 1 + fi + if ! mv ${_fm_src} ${_fm_dest}; then + msg "Can't move ${_fm_src} to ${_fm_dest}" + return 1 + fi + msg "Moved ${_fm_src} to ${_fm_dest}" + fi + return 0 +} + # # items @@ -267,45 +292,51 @@ do_ssh() op=$1 failed=0 - _dest=${DEST_ETC}/ssh - if [ ! -d "${_dest}" ]; then + _etcssh=${DEST_ETC}/ssh + if [ ! -d "${_etcssh}" ]; then if [ "${op}" = "check" ]; then - msg "${_dest} is not a directory" + msg "${_etcssh} is not a directory" failed=1 - elif ! mkdir ${_dest} ; then - msg "Can't create missing ${_dest}" + elif ! mkdir ${_etcssh} ; then + msg "Can't create missing ${_etcssh}" failed=1 else - msg "Missing ${_dest} created" + msg "Missing ${_etcssh} created" fi fi if [ ${failed} -eq 0 ]; then for f in \ - sshd.conf ssh.conf \ ssh_known_hosts ssh_known_hosts2 \ ssh_host_dsa_key ssh_host_dsa_key.pub \ ssh_host_rsa_key ssh_host_rsa_key.pub \ ssh_host_key ssh_host_key.pub \ ; do - fs=${DEST_ETC}/${f} - fd=${_dest}/${f} - if [ -f "${fs}" -a ! -f "${fd}" ]; then - if [ "${op}" = "check" ]; then - msg "Move ${fs} to ${fd}" - failed=1 - elif ! mv ${fs} ${fd}; then - msg "Can't move ${fs} to ${fd}" - failed=1 - else - msg "Moved ${fs} to ${fd}" - fi + if ! move_file ${op} ${DEST_ETC}/${f} ${_etcssh}/${f}; + then + failed=1 + fi + done + for f in sshd.conf ssh.conf ; do + # /etc/ssh{,d}.conf -> /etc/ssh/ssh{,d}_config + if ! move_file ${op} \ + ${DEST_ETC}/${f} ${_etcssh}/${f%.conf}_config ; + then + failed=1 + fi + # /etc/ssh/ssh{,d}.conf -> ssh{,d}_config + if ! move_file ${op} \ + ${_etcssh}/${f} ${_etcssh}/${f%.conf}_config ; + then + failed=1 fi done fi - if [ -f "${_dest}/sshd.conf" ]; then - sshdconf=${_dest}/sshd.conf + if [ -f "${_etcssh}/sshd_config" ]; then + sshdconf=${_etcssh}/sshd_config + elif [ -f "${_etcssh}/sshd.conf" ]; then + sshdconf=${_etcssh}/sshd.conf elif [ -f "${DEST_ETC}/sshd.conf" ]; then sshdconf=${DEST_ETC}/sshd.conf else @@ -445,10 +476,10 @@ main() fi done - if [ "${op}" = "fix" ]; then - plural="fixes" - else + if [ "${op}" = "check" ]; then plural="checks" + else + plural="fixes" fi echo "${PROGNAME} ${plural} passed:${items_passed}" diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd index 10a03c350a1..371f3798fd3 100755 --- a/etc/rc.d/sshd +++ b/etc/rc.d/sshd @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: sshd,v 1.17 2002/04/29 05:55:06 lukem Exp $ +# $NetBSD: sshd,v 1.18 2002/04/29 08:23:34 lukem Exp $ # # PROVIDE: sshd @@ -12,7 +12,7 @@ name="sshd" rcvar=$name command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -required_files="/etc/ssh/${name}.conf" +required_files="/etc/ssh/sshd_config" extra_commands="keygen reload" sshd_keygen() diff --git a/usr.bin/ssh/Makefile b/usr.bin/ssh/Makefile index a0cbbb8be43..b07d0ae97fb 100644 --- a/usr.bin/ssh/Makefile +++ b/usr.bin/ssh/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2002/03/11 04:57:57 itojun Exp $ +# $NetBSD: Makefile,v 1.16 2002/04/29 08:23:36 lukem Exp $ .include <bsd.own.mk> @@ -9,9 +9,9 @@ SUBDIR= libssh .WAIT ssh sshd ssh-add ssh-keygen ssh-agent scp sftp-server \ distribution: ${INSTALL_FILE} -o root -g wheel -m 644 \ - ${SSHDIST}/ssh_config ${DESTDIR}/etc/ssh/ssh.conf + ${SSHDIST}/ssh_config ${DESTDIR}/etc/ssh/ssh_config ${INSTALL_FILE} -o root -g wheel -m 644 \ - ${SSHDIST}/sshd_config ${DESTDIR}/etc/ssh/sshd.conf + ${SSHDIST}/sshd_config ${DESTDIR}/etc/ssh/sshd_config ${INSTALL_FILE} -o root -g wheel -m 444 \ ${SSHDIST}/moduli ${DESTDIR}/etc/moduli |
