summaryrefslogtreecommitdiff
path: root/debian/openssh-server.config
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-server.config')
-rw-r--r--debian/openssh-server.config29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/openssh-server.config b/debian/openssh-server.config
new file mode 100644
index 000000000..dbde2cbb0
--- /dev/null
+++ b/debian/openssh-server.config
@@ -0,0 +1,29 @@
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 -lne '
14 s/[[:space:]]+/ /g; s/[[:space:]]+$//;
15 print if s/^[[:space:]]*'"$option"'[[:space:]=]+//i' \
16 /etc/ssh/sshd_config 2>/dev/null
17}
18
19if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
20 [ "$(get_config_option PermitRootLogin)" = yes ]; then
21 if [ "$(getent shadow root | cut -d: -f2)" = "!" ]; then
22 db_set openssh-server/permit-root-login true
23 else
24 db_input high openssh-server/permit-root-login || true
25 db_go
26 fi
27fi
28
29exit 0