I have an old Ubuntu 14.04 computer and I want to give it away. I create a new administrator account and using this new account I deleted my old account and the entire content of this account. Is this a safe way to delete all the content of the computer or should I do an extra procedure?
-
To give it away, you will have to securelly erade the hard drive as described in the linked duplicate. – Bruni Aug 06 '19 at 14:53
2 Answers
The deleted data can still be recovered. To make it unrecoverable, boot the computer from a live CD. While booted from the live CD, open a command shell and type:
lsblk
That gives you a list of your hard drive devices. Device names look like sda (sdx where x is some letter, usually a, b, c, d...). Still in a command shell, run the following but replace the x to match each of your device names:
sudo dd if=/dev/zero of=/dev/sdx bs=512 count=1
That writes zeros for every data bit on the drive, which makes it so you can't recover the deleted data without special forensic tools.
If you want to take it a step farther, you can shred the drive. If shred isn't already installed you can install it:
sudo apt install shred
Shred overwrites the drive many times with random zeros and ones to make it virtually impossible to recover the data even with special tools.
shred -vfz -n 10 /dev/sdx
... again where "x" is the name of your hard-drive device.
About the switches: -v shows the progress of the shred, which is nice because it can take a very long time to shred a large drive. -f changes the file permissions if needed to allow shred to write over protected areas. -z writes all zeros on the final pass (other passes are random ones and zeros). The all zeros obscures the fact that the drive was shreded. -n is the number of shred passes over the hard drive: the more passes, the more secure, but the longer the shred process takes.

- 2,516
- 12
- 24
I'm guessing what you deleted was the home folder for that account. You will have gotten rid of most of their personal files and configs, but all their applications and possibly some more data will remain in the root folder. If you want to get rid of everything on the machine, I suggest reinstalling Ubuntu (during which you can choose to format the disk automatically) or another operating system.

- 86
-
I removed the entire content of the previous account (the one that I use to use). So I believe that the personal files and configs, but I am not sure if something else was left behind. – DanielTheRocketMan Aug 06 '19 at 11:14