srm
(or Secure Remove) is a
command line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
utility for
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
computer systems for secure
file deletion
File deletion is the removal of a computer file, file from a computer's file system.
All operating systems include commands for deleting files (rm (Unix), rm on Unix, del (command), era in CP/M and DR-DOS, del (command), del/del (command), eras ...
. srm removes each specified file by overwriting, renaming, and truncating it before unlinking. This prevents other people from undeleting or recovering any information about the file from the command line.
Platform-specific behaviours and bugs
Filesystems with hard links
Attempting to secure delete a file with multiple
hard link
In computing, a hard link is a directory entry (in a directory-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file acc ...
s results in a warning from srm stating that the current access path has been unlinked, but the data itself was not overwritten or truncated. This is an undocumented feature of srm 1.2.8 on
Mac OS X 10.9,
and is erroneously documented in 1.2.11 as a behaviour activated by the OpenBSD rm-compatible option
-P
.
However, in both the OS X and SourceForge srm implementations, the behaviour of unlinking but not overwriting multi-linked files is always active, as long as the platform reports hard links.
srm 1.2.8 on
Mac OS X 10.9 has a
-n
option, which means "overwrite file, but do not rename or unlink it."
However, if the file has multiple links, the multiple-link file data protection feature activates first, removing the file, even though the
-n
option specifies "do not rename or unlink the file".
The
-n
option has been removed from the code and manual of srm version 1.2.11, the latest
SourceForge.net
SourceForge is a web service that offers software consumers a centralized online location to control and manage open-source software projects and research business software. It provides source code repository hosting, bug tracking, mirroring ...
version. As a consequence, this option/feature conflict does not occur.
OS X
A number of file systems support
file forks (called
resource forks and named forks on OS X (particularly
HFS+
HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1 ...
), and alternate data streams on
NTFS
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred fil ...
), or
extended attributes Extended file attributes are file system features that enable users to associate computer files with metadata not interpreted by the filesystem, whereas regular attributes have a purpose strictly defined by the filesystem (such as permissions or ...
. However, OS X is the only platform on which srm securely deletes any of this additional data in files.
On OS X, only the most common non-data fork, the resource fork, is handled in this way.
This support was included in Appleās 1.2.8
and SourceForge's 1.2.9.
srm was removed from OS X/macOS in v10.11 El Capitan, as part of the removal of the "Secure Empty Trash" feature for security reasons.
OpenBSD
In srm 1.2.11, released on 25 November 2010,
the
OpenBSD
OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
rm-compatible option,
-P
, is documented have an overwriting pattern matching OpenBSD's rm.
Additional functionality which protects multi-linked files is documented under the OpenBSD-compatible option, but is actually always active.
Windows
When securely deleting files recursively, srm 1.2.11 is unable to determine device boundaries on Windows. Therefore, the
-x
option, which restricts srm to one
file system
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
, is not supported.
See also
*
rm (Unix)
rm (short for ''remove'') is a basic command on Unix and Unix-like operating systems used to remove objects such as computer files, directories and symbolic links from file systems and also special files such as device nodes, pipes and sockets, ...
: remove file in Unix.
*
Data remanence
Data remanence is the residual representation of digital data that remains even after attempts have been made to remove or erase the data. This residue may result from data being left intact by a nominal file deletion operation, by reformatting o ...
*
shred (Unix)
is a command on Unix-like operating systems that can be used to securely delete files and devices so that it is extremely difficult to recover them, even with specialized hardware and technology; assuming it's even possible to recover the file ...
*
List of free and open-source software packages
This is a list of free and open-source software packages, computer software licensed under free software licenses and open-source licenses. Software that fits the Free Software Definition may be more appropriately called free software; the GNU p ...
References
External links
Sourceforge Page
{{Data Erasure
Unix file system-related software
Unix security-related software
Data erasure software