summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/openssh-server.postinst20
1 files changed, 11 insertions, 9 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 35a6b477b..5635a60a6 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -157,6 +157,17 @@ create_sshdconfig() {
157 update_server_key_bits 157 update_server_key_bits
158 fi 158 fi
159 159
160 if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
161 [ "$(get_config_option PermitRootLogin)" = yes ] &&
162 db_get openssh-server/permit-root-login && [ "$RET" = true ]; then
163 set_config_option PermitRootLogin prohibit-password
164 fi
165
166 if dpkg --compare-versions "$2" lt-nl 1:7.1p1-1 && \
167 [ "$(get_config_option PermitRootLogin)" = without-password ]; then
168 set_config_option PermitRootLogin prohibit-password
169 fi
170
160 return 0 171 return 0
161 fi 172 fi
162 173
@@ -290,15 +301,6 @@ if [ "$action" = configure ]; then
290 # restart it under systemd. 301 # restart it under systemd.
291 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd || true 302 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd || true
292 fi 303 fi
293 if dpkg --compare-versions "$2" lt-nl 1:6.6p1-1 && \
294 [ "$(get_config_option PermitRootLogin)" = yes ] &&
295 db_get openssh-server/permit-root-login && [ "$RET" = true ]; then
296 set_config_option PermitRootLogin prohibit-password
297 fi
298 if dpkg --compare-versions "$2" lt-nl 1:7.1p1-1 && \
299 [ "$(get_config_option PermitRootLogin)" = without-password ]; then
300 set_config_option PermitRootLogin prohibit-password
301 fi
302fi 304fi
303 305
304#DEBHELPER# 306#DEBHELPER#