Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Securely Delete Files in Linux

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:

Using the shred Command

The shred command is a powerful tool for securely deleting files by overwriting them multiple times.

  1. Basic Usage:

    shred -u filename

    This command overwrites the file "filename" multiple times and then deletes it.

  2. Specifying the Number of Overwrites:

    shred -n 5 -u filename

    This command overwrites the file "filename" five times before deleting it.

  3. 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.

Using the wipe Command

The wipe command is another utility designed for secure file deletion.

  1. Install wipe:

    sudo apt-get install wipe
  2. Basic Usage:

    wipe filename

    This command securely deletes the file "filename".

  3. Wiping Directories:

    wipe -r dirname

    This command recursively wipes the directory "dirname" and all its contents.

Using dd for Secure Deletion

The dd command can be used creatively to overwrite files or even entire disks.

  1. 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.

  2. 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.

Using srm (Secure Remove)

The srm command is part of the Secure Deletion Toolkit and is specifically designed for secure file removal.

  1. Install srm:

    sudo apt-get install secure-delete
  2. Basic Usage:

    srm filename

    This command securely deletes the file "filename".

  3. Removing Directories:

    srm -r dirname

    This command recursively removes the directory "dirname" and all its contents securely.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.