summaryrefslogtreecommitdiff
path: root/debian/ssh-krb5.postinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2006-12-06 04:46:43 +0000
committerColin Watson <cjwatson@debian.org>2006-12-06 04:46:43 +0000
commit879756082fbdacc158ba04e8f770a1229c3daef4 (patch)
treeee240cb73f5e1d9d6c698242c95dc221ef5127c8 /debian/ssh-krb5.postinst
parentce57532d1450edba31c7a98937966a857cc2c397 (diff)
* Create transitional ssh-krb5 package which enables GSSAPI configuration
in sshd_config. * Default client to attempting GSSAPI authentication. * Remove obsolete GSSAPINoMICAuthentication from sshd_config if it's found.
Diffstat (limited to 'debian/ssh-krb5.postinst')
-rw-r--r--debian/ssh-krb5.postinst54
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/ssh-krb5.postinst b/debian/ssh-krb5.postinst
new file mode 100644
index 000000000..989a66801
--- /dev/null
+++ b/debian/ssh-krb5.postinst
@@ -0,0 +1,54 @@
1#!/bin/sh
2
3set -e
4
5action="$1"
6oldversion="$2"
7
8if [ "$action" = configure ] ; then
9 if dpkg --compare-versions "$oldversion" lt-nl 1:4.3p2-7; then
10 if [ ! -L /usr/share/doc/ssh-krb5 ]; then
11 rm -rf /usr/share/doc/ssh-krb5
12 ln -s openssh-client /usr/share/doc/ssh-krb5
13 fi
14
15 # Replaced by /etc/init.d/ssh.
16 if [ -f /etc/init.d/ssh-krb5 ]; then
17 mv /etc/init.d/ssh-krb5 /etc/init.d/ssh-krb5.dpkg-old
18 update-rc.d ssh-krb5 remove || true
19 fi
20 fi
21
22 if dpkg --compare-versions "$oldversion" ge 1:4.3p2-7 || \
23 grep -qi '^[ ]*GSSAPI' /etc/ssh/sshd_config ; then
24 :
25 else
26 if grep -qi '^#GSSAPI' /etc/ssh/sshd_config ; then
27 perl -pe 's/^\#(GSSAPI(Authentication|KeyExchange))\b/$1/i' \
28 < /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new
29 chown --reference /etc/ssh/sshd_config \
30 /etc/ssh/sshd_config.dpkg-new
31 chmod --reference /etc/ssh/sshd_config \
32 /etc/ssh/sshd_config.dpkg-new
33 mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config
34 else
35 cat >> /etc/ssh/sshd_config <<EOF
36
37# GSSAPI authentication
38GSSAPIAuthentication yes
39GSSAPIKeyExchange yes
40EOF
41 fi
42 if [ -x /etc/init.d/ssh ] ; then
43 if [ -x /usr/sbin/invoke-rc.d ] ; then
44 invoke-rc.d ssh restart
45 else
46 /etc/init.d/ssh restart
47 fi
48 fi
49 fi
50fi
51
52#DEBHELPER#
53
54exit 0