srm (Unix)
{{more citations needed|date=August 2010}}
{{Infobox software
| name = Secure Remove
| screenshot = Secure remove.png
| screenshot size = 250px
| caption = srm securely erasing a text file.
}}
{{lowercase|title=srm}}
srm
(or Secure Remove) is a command line utility for Unix-like computer systems for secure file deletion. 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 links 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
.{{cite web|title=srm - securely remove files or directories|accessdate=7 January 2014|author=Matt Gauthier|author-link=Matt Gauthier|location=Man Pages Section 1: Tools|url=http://manned.org/srm|work=srm 1.2.11}} 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.{{cite web|title=sunlink function in srm sunlink.c (SourceForge)|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://srm.cvs.sourceforge.net/viewvc/srm/srm/src/sunlink.c?revision=1.44|format=C Source|publisher=SourceForge.net|work=srm 1.2.11, sunlink.c CVS 1.44|date=24 December 2013}}
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."{{cite web|title=srm - securely remove files or directories|work=srm 1.2.8, OS X Version 10.9|publisher=Apple Inc.|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|location=Man Pages Section 1: Tools|url=https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/srm.1.html|date=20 September 2004}} 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 version. As a consequence, this option/feature conflict does not occur.{{cite web|title=srm main.c|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://srm.cvs.sourceforge.net/viewvc/srm/srm/src/main.c?revision=1.16|format=C Source|publisher=SourceForge.net|work=srm 1.2.11, main.c CVS 1.16|date=9 June 2011}}
=OS X=
A number of file systems support file forks (called resource forks and named forks on OS X (particularly HFS+), and alternate data streams on NTFS), or extended attributes. However, OS X is the only platform on which srm securely deletes any of this additional data in files.{{cite web|title=srm TODO|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://srm.cvs.sourceforge.net/viewvc/srm/srm/TODO?revision=1.34|format=Plain Text|publisher=SourceForge.net|work=srm 1.2.11, TODO CVS 1.34|date=24 December 2013}}
On OS X, only the most common non-data fork, the resource fork, is handled in this way.{{cite web|title=sunlink function in srm sunlink.c (OS X)|work=Darwin 13.0, OS X Version 10.9: Apple srm 7|publisher=Apple Inc.|accessdate=7 January 2014|author=Apple Inc., Matt Gauthier|url=https://opensource.apple.com/source/srm/srm-7/srm/src/sunlink.c|format=C Source}} This support was included in Apple’s {{mono|srm}} 1.2.8{{hsp}}{{cite web|title=Apple - Open Source|work=Darwin 13.0, OS X Version 10.9|publisher=Apple Inc.|accessdate=7 January 2014|author=Apple Inc.|url=https://www.apple.com/opensource/}}{{cite web|title=srm README.OsX (sic)|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://srm.cvs.sourceforge.net/viewvc/srm/srm/README.OsX?revision=1.2|format=Plain Text|publisher=SourceForge.net|work=srm 1.2.11, README.OsX (sic) CVS 1.2|date=22 November 2010}} and SourceForge's {{mono|srm}} 1.2.9.{{cite web|title=srm ChangeLog 2008-07-08|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://srm.cvs.sourceforge.net/viewvc/srm/srm/ChangeLog?revision=1.4|format=Plain Text|publisher=SourceForge.net|work=srm 1.2.11, ChangeLog CVS 1.4|date=25 November 2010}}
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.{{cite web|title=macbook pro - macOS High Sierra: Where is the Secure Empty Trash option? - Ask Different|accessdate=28 March 2021|url=https://apple.stackexchange.com/q/327239}}
=OpenBSD=
In srm 1.2.11, released on 25 November 2010,{{cite web|title=secure rm - Browse files at SourceForge.net|accessdate=7 January 2014|author=doj, null_pointer at SourceForge|url=http://manned.org/srm|publisher=SourceForge.net}} the OpenBSD 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, is not supported.
See also
- rm (Unix): remove file in Unix.
- Data remanence
- shred (Unix)
- List of free and open-source software packages
References
{{Reflist}}
External links
- [http://srm.sourceforge.net/ Sourceforge Page]
{{Data Erasure}}
Category:Unix file system-related software