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 file from a computer's file system.
All operating systems include commands for deleting files ( rm on Unix, era in CP/M and DR-DOS, del/ erase in MS-DOS/PC DOS, DR-DOS, Microsoft Windows etc.). File manager ...
. 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 ac ...
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
OS X Mavericks (version 10.9) is the 10th major release of macOS, Apple Inc.'s desktop and server operating system for Macintosh computers. OS X Mavericks was announced on June 10, 2013, at WWDC 2013, and was released on October 22, 2013, w ...
,
[ 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
OS X Mavericks (version 10.9) is the 10th major release of macOS, Apple Inc.'s desktop and server operating system for Macintosh computers. OS X Mavericks was announced on June 10, 2013, at WWDC 2013, and was released on October 22, 2013, w ...
[ 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, Mirror site ...
version. As a consequence, this option/feature conflict does not occur.
OS X
A number of file systems support file forks (called resource forks The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the dat ...
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. ...
), 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 f ...
), or extended attributes. 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 operating system, 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 fork (software development), forking N ...
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 lar ...
, 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)
*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 ...
References
External links
Sourceforge Page
{{Data Erasure
Unix file system-related software
Unix security-related software
Data erasure software