diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | contrib/redhat/openssh.spec | 26 | ||||
-rwxr-xr-x | contrib/redhat/sshd.init | 101 | ||||
-rwxr-xr-x | contrib/redhat/sshd.init-5.x | 61 |
4 files changed, 140 insertions, 52 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20000808 | ||
2 | - (djm) Cleanup Redhat RPMs. Generate keys at runtime rather than install | ||
3 | time, spec file cleanup. | ||
4 | |||
1 | 20000807 | 5 | 20000807 |
2 | - (djm) Set 0755 on binaries during install. Report from Lutz Jaenicke | 6 | - (djm) Set 0755 on binaries during install. Report from Lutz Jaenicke |
3 | - (djm) Suppress error messages on channel close shutdown() failurs | 7 | - (djm) Suppress error messages on channel close shutdown() failurs |
diff --git a/contrib/redhat/openssh.spec b/contrib/redhat/openssh.spec index e1feb778e..e593f2813 100644 --- a/contrib/redhat/openssh.spec +++ b/contrib/redhat/openssh.spec | |||
@@ -1,5 +1,5 @@ | |||
1 | # Version of OpenSSH | 1 | # Version of OpenSSH |
2 | %define oversion 2.1.1p4 | 2 | %define oversion 2.1.1p5 |
3 | 3 | ||
4 | # Version of ssh-askpass | 4 | # Version of ssh-askpass |
5 | %define aversion 1.0 | 5 | %define aversion 1.0 |
@@ -14,9 +14,9 @@ Summary: OpenSSH free Secure Shell (SSH) implementation | |||
14 | Name: openssh | 14 | Name: openssh |
15 | Version: %{oversion} | 15 | Version: %{oversion} |
16 | Release: 1 | 16 | Release: 1 |
17 | Packager: Damien Miller <djm@ibs.com.au> | 17 | Packager: Damien Miller <djm@mindrot.org> |
18 | URL: http://www.openssh.com/ | 18 | URL: http://www.openssh.com/ |
19 | Source0: http://violet.ibs.com.au/openssh/files/openssh-%{oversion}.tar.gz | 19 | Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{oversion}.tar.gz |
20 | Source1: http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz | 20 | Source1: http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz |
21 | Copyright: BSD | 21 | Copyright: BSD |
22 | Group: Applications/Internet | 22 | Group: Applications/Internet |
@@ -27,14 +27,14 @@ Requires: openssl >= 0.9.5a | |||
27 | BuildPreReq: perl | 27 | BuildPreReq: perl |
28 | BuildPreReq: openssl-devel | 28 | BuildPreReq: openssl-devel |
29 | BuildPreReq: tcp_wrappers | 29 | BuildPreReq: tcp_wrappers |
30 | %if ! %{no_x11_askpass} | 30 | %if ! %{no_gnome_askpass} |
31 | BuildPreReq: gnome-libs-devel | 31 | BuildPreReq: gnome-libs-devel |
32 | %endif | 32 | %endif |
33 | 33 | ||
34 | %package clients | 34 | %package clients |
35 | Summary: OpenSSH Secure Shell protocol clients | 35 | Summary: OpenSSH Secure Shell protocol clients |
36 | Requires: openssh | 36 | Requires: openssh |
37 | Group: System Environment/Daemons | 37 | Group: Applications/Internet |
38 | Obsoletes: ssh-clients | 38 | Obsoletes: ssh-clients |
39 | 39 | ||
40 | %package server | 40 | %package server |
@@ -127,6 +127,9 @@ patented algorithms to seperate libraries (OpenSSL). | |||
127 | This package contains the GNOME passphrase dialog. | 127 | This package contains the GNOME passphrase dialog. |
128 | 128 | ||
129 | %changelog | 129 | %changelog |
130 | * Tue Aug 08 2000 Damien Miller <djm@mindrot.org> | ||
131 | - Some surgery to sshd.init (generate keys at runtime) | ||
132 | - Cleanup of groups and removal of keygen calls | ||
130 | * Wed Jul 12 2000 Damien Miller <djm@mindrot.org> | 133 | * Wed Jul 12 2000 Damien Miller <djm@mindrot.org> |
131 | - Make building of X11-askpass and gnome-askpass optional | 134 | - Make building of X11-askpass and gnome-askpass optional |
132 | * Mon Jun 12 2000 Damien Miller <djm@mindrot.org> | 135 | * Mon Jun 12 2000 Damien Miller <djm@mindrot.org> |
@@ -208,20 +211,12 @@ rm -rf $RPM_BUILD_ROOT | |||
208 | 211 | ||
209 | %post server | 212 | %post server |
210 | /sbin/chkconfig --add sshd | 213 | /sbin/chkconfig --add sshd |
211 | if [ ! -f /etc/ssh/ssh_host_key -o ! -s /etc/ssh/ssh_host_key ]; then | 214 | if test -r /var/run/sshd.pid ; then |
212 | /usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N '' >&2 | ||
213 | fi | ||
214 | if [ ! -f /etc/ssh/ssh_host_dsa_key -o ! -s /etc/ssh/ssh_host_dsa_key ]; then | ||
215 | /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' >&2 | ||
216 | fi | ||
217 | if test -r /var/run/sshd.pid | ||
218 | then | ||
219 | /etc/rc.d/init.d/sshd restart >&2 | 215 | /etc/rc.d/init.d/sshd restart >&2 |
220 | fi | 216 | fi |
221 | 217 | ||
222 | %preun server | 218 | %preun server |
223 | if [ "$1" = 0 ] | 219 | if [ "$1" = 0 ] ; then |
224 | then | ||
225 | /etc/rc.d/init.d/sshd stop >&2 | 220 | /etc/rc.d/init.d/sshd stop >&2 |
226 | /sbin/chkconfig --del sshd | 221 | /sbin/chkconfig --del sshd |
227 | fi | 222 | fi |
@@ -272,4 +267,3 @@ fi | |||
272 | %defattr(-,root,root) | 267 | %defattr(-,root,root) |
273 | %attr(0755,root,root) /usr/libexec/ssh/gnome-ssh-askpass | 268 | %attr(0755,root,root) /usr/libexec/ssh/gnome-ssh-askpass |
274 | %endif | 269 | %endif |
275 | |||
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init index cac91bb51..487d12897 100755 --- a/contrib/redhat/sshd.init +++ b/contrib/redhat/sshd.init | |||
@@ -17,44 +17,73 @@ | |||
17 | 17 | ||
18 | RETVAL=0 | 18 | RETVAL=0 |
19 | 19 | ||
20 | case "$1" in | 20 | # Some functions to make the below more readable |
21 | start) | 21 | KEYGEN=/usr/bin/ssh-keygen |
22 | echo -n "Starting sshd: " | 22 | RSA_KEY=/etc/ssh/ssh_host_key |
23 | if [ ! -f /var/run/sshd.pid ] ; then | 23 | DSA_KEY=/etc/ssh/ssh_host_dsa_key |
24 | case "`type -type success`" in | 24 | PID_FILE=/var/run/sshd.pid |
25 | function) | 25 | do_rsa_keygen() { |
26 | /usr/sbin/sshd && success "sshd startup" || failure "sshd startup" | 26 | if $KEYGEN -R && ! test -f $RSA_KEY ; then |
27 | RETVAL=$? | 27 | echo -n "Generating SSH RSA host key: " |
28 | ;; | 28 | if $KEYGEN -q -b 1024 -f $RSA_KEY -C '' -N '' >&/dev/null; then |
29 | *) | 29 | success "RSA key generation" |
30 | /usr/sbin/sshd && echo -n "sshd " | 30 | echo |
31 | RETVAL=$? | 31 | else |
32 | ;; | 32 | failure "RSA key generation" |
33 | esac | 33 | echo |
34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd | 34 | exit 1 |
35 | fi | ||
35 | fi | 36 | fi |
36 | echo | 37 | } |
37 | ;; | 38 | do_dsa_keygen() { |
38 | stop) | 39 | if ! test -f $DSA_KEY ; then |
39 | echo -n "Shutting down sshd: " | 40 | echo -n "Generating SSH DSA host key: " |
40 | if [ -f /var/run/sshd.pid ] ; then | 41 | if $KEYGEN -q -d -b 1024 -f $DSA_KEY -C '' -N '' >&/dev/null; then |
41 | killproc sshd | 42 | success "DSA key generation" |
43 | echo | ||
44 | else | ||
45 | failure "DSA key generation" | ||
46 | echo | ||
47 | exit 1 | ||
48 | fi | ||
42 | fi | 49 | fi |
43 | echo | 50 | } |
44 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd | 51 | |
45 | ;; | 52 | case "$1" in |
46 | restart) | 53 | start) |
47 | $0 stop | 54 | # Create keys if necessary |
48 | $0 start | 55 | do_rsa_keygen; |
49 | RETVAL=$? | 56 | do_dsa_keygen; |
50 | ;; | 57 | |
51 | status) | 58 | echo -n "Starting sshd: " |
52 | status sshd | 59 | if [ ! -f $PID_FILE ] ; then |
53 | RETVAL=$? | 60 | daemon sshd |
54 | ;; | 61 | RETVAL=$? |
55 | *) | 62 | touch /var/lock/subsys/sshd |
56 | echo "Usage: sshd {start|stop|restart|status}" | 63 | fi |
57 | exit 1 | 64 | echo |
65 | ;; | ||
66 | stop) | ||
67 | echo -n "Shutting down sshd: " | ||
68 | if [ -f $PID_FILE ] ; then | ||
69 | killproc sshd | ||
70 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd | ||
71 | fi | ||
72 | echo | ||
73 | ;; | ||
74 | restart) | ||
75 | $0 stop | ||
76 | $0 start | ||
77 | RETVAL=$? | ||
78 | ;; | ||
79 | status) | ||
80 | status sshd | ||
81 | RETVAL=$? | ||
82 | ;; | ||
83 | *) | ||
84 | echo "Usage: sshd {start|stop|restart|status}" | ||
85 | exit 1 | ||
86 | ;; | ||
58 | esac | 87 | esac |
59 | 88 | ||
60 | exit $RETVAL | 89 | exit $RETVAL |
diff --git a/contrib/redhat/sshd.init-5.x b/contrib/redhat/sshd.init-5.x new file mode 100755 index 000000000..e836b6919 --- /dev/null +++ b/contrib/redhat/sshd.init-5.x | |||
@@ -0,0 +1,61 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Init file for OpenSSH server daemon | ||
4 | # | ||
5 | # chkconfig: 2345 55 25 | ||
6 | # description: OpenSSH server daemon | ||
7 | # | ||
8 | # processname: sshd | ||
9 | # config: /etc/ssh/ssh_host_key | ||
10 | # config: /etc/ssh/ssh_host_key.pub | ||
11 | # config: /etc/ssh/ssh_random_seed | ||
12 | # config: /etc/ssh/sshd_config | ||
13 | # pidfile: /var/run/sshd.pid | ||
14 | |||
15 | # source function library | ||
16 | . /etc/rc.d/init.d/functions | ||
17 | |||
18 | RETVAL=0 | ||
19 | |||
20 | case "$1" in | ||
21 | start) | ||
22 | echo -n "Starting sshd: " | ||
23 | if [ ! -f /var/run/sshd.pid ] ; then | ||
24 | case "`type -type success`" in | ||
25 | function) | ||
26 | /usr/sbin/sshd && success "sshd startup" || failure "sshd startup" | ||
27 | RETVAL=$? | ||
28 | ;; | ||
29 | *) | ||
30 | /usr/sbin/sshd && echo -n "sshd " | ||
31 | RETVAL=$? | ||
32 | ;; | ||
33 | esac | ||
34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd | ||
35 | fi | ||
36 | echo | ||
37 | ;; | ||
38 | stop) | ||
39 | echo -n "Shutting down sshd: " | ||
40 | if [ -f /var/run/sshd.pid ] ; then | ||
41 | killproc sshd | ||
42 | fi | ||
43 | echo | ||
44 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd | ||
45 | ;; | ||
46 | restart) | ||
47 | $0 stop | ||
48 | $0 start | ||
49 | RETVAL=$? | ||
50 | ;; | ||
51 | status) | ||
52 | status sshd | ||
53 | RETVAL=$? | ||
54 | ;; | ||
55 | *) | ||
56 | echo "Usage: sshd {start|stop|restart|status}" | ||
57 | exit 1 | ||
58 | ;; | ||
59 | esac | ||
60 | |||
61 | exit $RETVAL | ||