summaryrefslogtreecommitdiff
path: root/debian/openssh-server.config
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2016-12-24 19:26:39 +0000
committerColin Watson <cjwatson@debian.org>2016-12-26 00:30:30 +0000
commitde911c73504da8dd7d9bbaddcf0c0845dd6eb9a0 (patch)
treec1be675cab068c60f7461a67b396961227c9ae6d /debian/openssh-server.config
parent9477f029ee259b25daff503e02e6b011aea82ce3 (diff)
parentaf54c22db774b37a15df5e599d08a83d4bbe5079 (diff)
Start handling /etc/ssh/sshd_config using ucf.
* Start handling /etc/ssh/sshd_config using ucf. The immediate motivation for this is to deal with deprecations of options related to protocol 1, but something like this has been needed for a long time (closes: #419574, #848089): - sshd_config is now a slightly-patched version of upstream's, and only contains non-default settings (closes: #147201). - I've included as many historical md5sums of default versions of sshd_config as I could reconstruct from version control, but I'm sure I've missed some. - Explicitly synchronise the debconf database with the current configuration file state in openssh-server.config, to ensure that the PermitRootLogin setting is properly preserved. - UsePrivilegeSeparation now defaults to the stronger "sandbox" rather than "yes", per upstream.
Diffstat (limited to 'debian/openssh-server.config')
-rw-r--r--debian/openssh-server.config13
1 files changed, 12 insertions, 1 deletions
diff --git a/debian/openssh-server.config b/debian/openssh-server.config
index dbde2cbb0..67a074ec2 100644
--- a/debian/openssh-server.config
+++ b/debian/openssh-server.config
@@ -16,8 +16,19 @@ get_config_option() {
16 /etc/ssh/sshd_config 2>/dev/null 16 /etc/ssh/sshd_config 2>/dev/null
17} 17}
18 18
19permit_root_login="$(get_config_option PermitRootLogin)"
20if [ -f /etc/ssh/sshd_config ]; then
21 # Make sure the debconf database is in sync with the current state
22 # of the system.
23 if [ "$permit_root_login" = yes ]; then
24 db_set openssh-server/permit-root-login false
25 else
26 db_set openssh-server/permit-root-login true
27 fi
28fi
29
19if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \ 30if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
20 [ "$(get_config_option PermitRootLogin)" = yes ]; then 31 [ "$permit_root_login" = yes ]; then
21 if [ "$(getent shadow root | cut -d: -f2)" = "!" ]; then 32 if [ "$(getent shadow root | cut -d: -f2)" = "!" ]; then
22 db_set openssh-server/permit-root-login true 33 db_set openssh-server/permit-root-login true
23 else 34 else