post_install() { if [ "$(getent group sshd | cut -d ":" -f 3)" != "50" ]; then groupadd -g 50 sshd fi if [ "$(getent passwd sshd | cut -d ":" -f 3)" != "50" ]; then useradd -c 'sshd PrivSep' \ -d /var/lib/sshd \ -g sshd \ -s /bin/false \ -u 50 sshd fi systemctl enable sshd.service /usr/bin/ssh-keygen -A } post_upgrade() { post_install } pre_remove() { systemctl stop sshd.service systemctl disable sshd.service } post_remove() { groupdel sshd 2>/dev/null || true userdel sshd 2>/dev/null || true }