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.postrm26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/openssh-server.postrm b/debian/openssh-server.postrm
new file mode 100644
index 000000000..33191522b
--- /dev/null
+++ b/debian/openssh-server.postrm
@@ -0,0 +1,26 @@
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/sshd_config
17 rm -f /etc/ssh/sshd_not_to_be_run
18 rmdir --ignore-fail-on-non-empty /etc/ssh
19
20 if which deluser >/dev/null 2>&1; then
21 deluser --quiet sshd > /dev/null || true
22 fi
23 ;;
24esac
25
26exit 0