Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Securely deleting files is an essential practice for maintaining privacy and security on your Linux system. When you delete a file using the standard methods, such as the rm
command, the file is not actually erased from the disk; instead, the space it occupied is marked as available for new data. This means that the file can potentially be recovered using data recovery tools. To prevent this, you need to overwrite the file's data, making it irretrievable. This article will guide you through several methods to securely delete files on a Linux system.
shred
CommandThe shred
command is a standard utility in Linux used to securely delete files by overwriting them multiple times.
Example:
shred -u -n 3 -z sensitive_file.txt
-u
: Remove the file after overwriting.-n 3
: Overwrite the file 3 times. You can increase this number for more security.-z
: Add a final overwrite with zeros to hide shredding.wipe
CommandThe wipe
command is another tool designed to securely erase files and free disk space.
Example:
wipe -f sensitive_file.txt
-f
: Force the operation without asking for confirmation.dd
CommandThe dd
command can be used creatively to overwrite a file with random data.
Example:
dd if=/dev/urandom of=sensitive_file.txt bs=1M count=1
rm sensitive_file.txt
if=/dev/urandom
: Use random data as input.of=sensitive_file.txt
: Output to the file you want to overwrite.bs=1M
: Block size of 1 Megabyte.count=1
: Write 1 block of random data.srm
CommandThe srm
command is part of the Secure Deletion Toolkit, which offers a secure way to delete files.
Example:
srm -v sensitive_file.txt
-v
: Verbose mode, shows progress.To use srm
, you may need to install the secure-delete package:
sudo apt-get install secure-delete