summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2018-01-26 00:07:45 +0000
committerColin Watson <cjwatson@debian.org>2018-01-26 00:07:50 +0000
commit5e133f112d8a05c0f7c466fc793514e2a1ee8285 (patch)
tree56894484966369c13e281e0d37eff2c91ca087b0 /debian/openssh-server.postinst
parent83263a49b0e2ade36a7f0d01d06a0453f8c7ef3f (diff)
Add debconf template to disable password auth
The new template is called openssh-server/password-authentication, and is preseeding-only (at least for now). Closes: #878945
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r--debian/openssh-server.postinst6
1 files changed, 6 insertions, 0 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 94a47da20..ae273e9c8 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -88,6 +88,8 @@ create_sshdconfig() {
88 # false -> yes. 88 # false -> yes.
89 db_get openssh-server/permit-root-login 89 db_get openssh-server/permit-root-login
90 permit_root_login="$RET" 90 permit_root_login="$RET"
91 db_get openssh-server/password-authentication
92 password_authentication="$RET"
91 93
92 trap cleanup EXIT 94 trap cleanup EXIT
93 new_config="$(tempfile)" 95 new_config="$(tempfile)"
@@ -96,6 +98,10 @@ create_sshdconfig() {
96 sed -i 's/^#*PermitRootLogin .*/PermitRootLogin yes/' \ 98 sed -i 's/^#*PermitRootLogin .*/PermitRootLogin yes/' \
97 "$new_config" 99 "$new_config"
98 fi 100 fi
101 if [ "$password_authentication" != true ]; then
102 sed -i 's/^#PasswordAuthentication .*/PasswordAuthentication no/' \
103 "$new_config"
104 fi
99 mkdir -p /etc/ssh 105 mkdir -p /etc/ssh
100 ucf --three-way --debconf-ok \ 106 ucf --three-way --debconf-ok \
101 --sum-file /usr/share/openssh/sshd_config.md5sum \ 107 --sum-file /usr/share/openssh/sshd_config.md5sum \