Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created May 19, 2026 08:49
Show Gist options
  • Select an option

  • Save niraj-shah/28be495023dde06d87bbf6ac60839bb8 to your computer and use it in GitHub Desktop.

Select an option

Save niraj-shah/28be495023dde06d87bbf6ac60839bb8 to your computer and use it in GitHub Desktop.
Securely delete files and remove the cPanel account
#!/bin/bash
# Check if username is provided
if [ -z "$1" ]; then
echo "Usage: $0 <username>"
exit 1
fi
USERNAME=$1
find "/home/$USERNAME" -type f -exec shred -uvz {} \;
/usr/local/cpanel/scripts/removeacct --force "$USERNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment