summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-server.postinst')
-rw-r--r--debian/openssh-server.postinst11
1 files changed, 10 insertions, 1 deletions
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index ccacb411a..1ac6906da 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -289,9 +289,15 @@ fix_statoverride() {
289 fi 289 fi
290} 290}
291 291
292fix_sshd_shell() {
293 if getent passwd sshd | grep ':/bin/false$'; then
294 usermod -s /usr/sbin/nologin sshd
295 fi
296}
297
292setup_sshd_user() { 298setup_sshd_user() {
293 if ! getent passwd sshd >/dev/null; then 299 if ! getent passwd sshd >/dev/null; then
294 adduser --quiet --system --no-create-home --home /var/run/sshd sshd 300 adduser --quiet --system --no-create-home --home /var/run/sshd --shell /usr/sbin/nologin sshd
295 fi 301 fi
296} 302}
297 303
@@ -318,6 +324,9 @@ create_sshdconfig
318check_idea_key 324check_idea_key
319create_keys 325create_keys
320fix_statoverride 326fix_statoverride
327if dpkg --compare-versions "$2" lt 1:4.3p2-3; then
328 fix_sshd_shell
329fi
321setup_sshd_user 330setup_sshd_user
322if dpkg --compare-versions "$2" lt 1:3.6.1p2-2; then 331if dpkg --compare-versions "$2" lt 1:3.6.1p2-2; then
323 fix_conffile_permissions 332 fix_conffile_permissions