Web Niraj
  • Facebook
  • Flickr
  • Github
  • Linkedin
  • Twitter
  • YouTube
Online portfolio, code examples and developer blog
  • About
  • Contact
  • Portfolio
  • WordPress
Search the site...
  • Home
  • Blog
  • Securely Delete a cPanel User’s Files and Account

Securely Delete a cPanel User’s Files and Account

0

Following on from my previous article on How to Securely Delete Files on Linux, I recently had the need to apply this to cPanel. After moving user accounts to a new server, I wanted to securely delete all the files and accounts from the old server.

To achieve this, I combined the command line covered in my previous article along with some cPanel specific scripts. Namely, the removeacct script that cPanel providers to remove a user’s account from the command line. Note that root login credentials are required to run this script.

While the removeacct deletes the user’s files and account, it does not delete them securely. So, I used the following script to combine the secure shred method and removeacct:

The secure-remove.sh script above accepts a cPanel account name as the first parameter, e.g.:

./secure-remove.sh accountname

If an invalid name or directory is supplied, both scripts (on lines 11 and 12) will fail gracefully. Note that the removeacct script uses the --force flag, which means the user’s cPanel account will be deleted even if all the files are not securely removed.

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StackExchange / StackOverflow

profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

Support Me

Buy Me a Coffee

PSN Profile

Tags

ACL Amazon Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache Backup Bug Command Line Cordova cPanel / WHM Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Firewall Flash Geolocation Google Nexus 5 Hacking HTML5 iOS IP Abuse JavaScript jQuery Laravel 5 Linux NodeJS Parse PDF PHP Plugin Portfolio PS4 Review Security Server SSH SSL Sysadmin Tutorial WordPress WordPress Plugins

© 2011-2026 Niraj Shah
  • Blog
  • Portfolio
  • WordPress
  • About Me
  • Contact Me
  • Privacy Policy
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Privacy Policy