summaryrefslogtreecommitdiff
path: root/debian/openssh-server.postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-server.postrm')
-rw-r--r--debian/openssh-server.postrm35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm
new file mode 100644
index 000000000..4a716f563
--- /dev/null
+++ b/debian/openssh-server.postrm
@@ -0,0 +1,35 @@
1#!/bin/sh
2set -e
3
4#DEBHELPER#
5
6case $1 in
7 purge)
8 # Remove all non-conffiles that ssh might create, so that we
9 # can smoothly remove /etc/ssh if and only if the user
10 # hasn't dropped some other files in there. Conffiles have
11 # already been removed at this point.
12 rm -f /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub
13 rm -f /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub
14 rm -f /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub
15 rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key.pub
16 rm -f /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_ed25519_key.pub
17 for ext in .ucf-new .ucf-old .ucf-dist ""; do
18 rm -f "/etc/ssh/sshd_config$ext"
19 done
20 if which ucf >/dev/null 2>&1; then
21 ucf --purge /etc/ssh/sshd_config
22 fi
23 if which ucfr >/dev/null 2>&1; then
24 ucfr --purge openssh-server /etc/ssh/sshd_config
25 fi
26 rm -f /etc/ssh/sshd_not_to_be_run
27 [ ! -d /etc/ssh ] || rmdir --ignore-fail-on-non-empty /etc/ssh
28
29 if which deluser >/dev/null 2>&1; then
30 deluser --quiet sshd > /dev/null || true
31 fi
32 ;;
33esac
34
35exit 0