summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/postinst4
1 files changed, 3 insertions, 1 deletions
diff --git a/debian/postinst b/debian/postinst
index 5d0e32fef..0d1f3c3ed 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -60,15 +60,17 @@ create_sshdconfig() {
60 if dpkg --compare-versions "$oldversion" lt-nl 1:1.3 ; then 60 if dpkg --compare-versions "$oldversion" lt-nl 1:1.3 ; then
61 db_get ssh/new_config 61 db_get ssh/new_config
62 if [ "$RET" = "false" ] ; then return 0; fi 62 if [ "$RET" = "false" ] ; then return 0; fi
63 elif dpkg --compare-versions "$oldversion" lt-nl 1:3.7.1p2-1 && \ 63 elif dpkg --compare-versions "$oldversion" lt-nl 1:3.8p1-1 && \
64 ! grep -iq ^UsePAM /etc/ssh/sshd_config ; then 64 ! grep -iq ^UsePAM /etc/ssh/sshd_config ; then
65 # Upgrade from pre-3.7: UsePAM needed to maintain standard 65 # Upgrade from pre-3.7: UsePAM needed to maintain standard
66 # Debian configuration. 66 # Debian configuration.
67 echo -n 'Upgrading sshd_config (old version in .dpkg-old) ...'
67 cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-old 68 cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.dpkg-old
68 perl -pe 's/^(PAMAuthenticationViaKbdInt|RhostsAuthentication)\b/#$1/i' \ 69 perl -pe 's/^(PAMAuthenticationViaKbdInt|RhostsAuthentication)\b/#$1/i' \
69 /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new 70 /etc/ssh/sshd_config > /etc/ssh/sshd_config.dpkg-new
70 echo 'UsePAM yes' >> /etc/ssh/sshd_config.dpkg-new 71 echo 'UsePAM yes' >> /etc/ssh/sshd_config.dpkg-new
71 mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config 72 mv /etc/ssh/sshd_config.dpkg-new /etc/ssh/sshd_config
73 echo
72 return 0 74 return 0
73 else return 0 75 else return 0
74 fi 76 fi