summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-03-20 02:14:01 +0000
committerColin Watson <cjwatson@debian.org>2014-03-27 15:50:29 +0000
commit0a00050c1e005182cb69c672eb53000b9dcdba2c (patch)
tree6e1b4c319ed0cd4638320aebd28c3a4955e2e3c7 /debian/openssh-server.postinst
parent96f6b414c09ec85a923e02df06a90d935283f06e (diff)
Change to "PermitRootLogin without-password" for new installations
Also ask a debconf question when upgrading systems with "PermitRootLogin yes" from previous versions. Closes: #298138
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r--debian/openssh-server.postinst12
1 files changed, 11 insertions, 1 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 0189f5fbb..daa0f6796 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -1,6 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3 3
4. /usr/share/debconf/confmodule
5db_version 2.0
6
4action="$1" 7action="$1"
5oldversion="$2" 8oldversion="$2"
6 9
@@ -193,7 +196,7 @@ LogLevel INFO
193 196
194# Authentication: 197# Authentication:
195LoginGraceTime 120 198LoginGraceTime 120
196PermitRootLogin yes 199PermitRootLogin without-password
197StrictModes yes 200StrictModes yes
198 201
199RSAAuthentication yes 202RSAAuthentication yes
@@ -305,8 +308,15 @@ if [ "$action" = configure ]; then
305 # restart it under systemd. 308 # restart it under systemd.
306 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd || true 309 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd || true
307 fi 310 fi
311 if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
312 [ "$(get_config_option PermitRootLogin)" = yes ] &&
313 db_get openssh-server/permit-root-login && [ "$RET" = true ]; then
314 set_config_option PermitRootLogin without-password
315 fi
308fi 316fi
309 317
310#DEBHELPER# 318#DEBHELPER#
311 319
320db_stop
321
312exit 0 322exit 0