# This is a default template for a post-install scriptlet. # Uncomment only required functions and remove any functions # you don't need (and this header). post_install() { if [ "$(getent group sshd | cut -d ":" -f 3)" != "52" ]; then groupadd -g 50 sshd fi if [ "$(getent passwd sshd | cut -d ":" -f 3)" != "52" ]; 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 }