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

=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

References

{{Reflist}}