summaryrefslogtreecommitdiff
path: root/debian/openssh-server.config
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.config
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.config')
-rw-r--r--debian/openssh-server.config23
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/openssh-server.config b/debian/openssh-server.config
new file mode 100644
index 000000000..27594ad2d
--- /dev/null
+++ b/debian/openssh-server.config
@@ -0,0 +1,23 @@
1#! /bin/sh
2set -e
3
4. /usr/share/debconf/confmodule
5db_version 2.0
6
7get_config_option() {
8 option="$1"
9
10 [ -f /etc/ssh/sshd_config ] || return
11
12 # TODO: actually only one '=' allowed after option
13 perl -ne 'print if s/^[[:space:]]*'"$option"'[[:space:]=]+//i' \
14 /etc/ssh/sshd_config 2>/dev/null
15}
16
17if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
18 [ "$(get_config_option PermitRootLogin)" = yes ]; then
19 db_input high openssh-server/permit-root-login || true
20 db_go
21fi
22
23exit 0