Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
In the digital age, securely deleting files is crucial to protect sensitive information from unauthorized access. Simply deleting a file in Linux does not remove its contents from the disk; instead, it only removes the reference to the file. The data remains on the disk until it is overwritten by new data, which can potentially be recovered using data recovery tools. Secure deletion ensures that the data is irretrievably destroyed. This article will guide you through various methods to securely delete files in Linux, ensuring your sensitive information remains private.
Examples:
shred
CommandThe shred
command is a powerful tool for securely deleting files by overwriting them multiple times.
Basic Usage:
shred -u filename
This command overwrites the file "filename" multiple times and then deletes it.
Specifying the Number of Overwrites:
shred -n 5 -u filename
This command overwrites the file "filename" five times before deleting it.
Overwriting with Random Data:
shred -v -z filename
This command overwrites the file "filename" with random data and then with zeros for a final overwrite, providing an additional layer of security.
wipe
CommandThe wipe
command is another utility designed for secure file deletion.
Install wipe
:
sudo apt-get install wipe
Basic Usage:
wipe filename
This command securely deletes the file "filename".
Wiping Directories:
wipe -r dirname
This command recursively wipes the directory "dirname" and all its contents.
dd
for Secure DeletionThe dd
command can be used creatively to overwrite files or even entire disks.
Overwriting a File:
dd if=/dev/urandom of=filename bs=1M count=1
This command overwrites the file "filename" with random data from /dev/urandom
.
Overwriting a Disk:
dd if=/dev/zero of=/dev/sdX bs=1M
This command overwrites the entire disk /dev/sdX
with zeros. Be very careful with this command as it will destroy all data on the specified disk.
srm
(Secure Remove)The srm
command is part of the Secure Deletion Toolkit and is specifically designed for secure file removal.
Install srm
:
sudo apt-get install secure-delete
Basic Usage:
srm filename
This command securely deletes the file "filename".
Removing Directories:
srm -r dirname
This command recursively removes the directory "dirname" and all its contents securely.