News for hackers. Stuff that matters.
Re:Rm does not permanently delete files by throwaway7767 on Thursday May 19, 2016 @09:44AM (#11730092)
This functionality already exists in GNU coreutils, it's done by the shred(1) command. No need to install any extra third-party software, shred is already installed.

Also, as another commenter already pointed out, this kind of in-place overwrite is not guaranteed to work on SSDs, and it's also not guaranteed to work on filesystems with copy-on-write semantics. If you're really concerned with this, you should be doing full-disk encryption.

Re:Rm does not permanently delete files by masklinn on Thursday May 19, 2016 @09:55AM (#11730173)
> This functionality already exists in GNU coreutils, it's done by the shred(1) command. No need to install any extra third-party software, shred is already installed.

That's only true for GNU-based userlands, not BSD-based ones.

> Also, as another commenter already pointed out, this kind of in-place overwrite is not guaranteed to work on SSDs

And if the system properly TRIMs it might not be necessary at all, though that greatly depends on the SSD.

Re:Rm does not permanently delete files by throwaway7767 on Thursday May 19, 2016 @10:00AM (#11730214)
> That's only true for GNU-based userlands, not BSD-based ones.

Sure, but installing (a subset of) GNU coreutils is probably going to pull in a lot fewer dependencies than this JavaScript command line tool. Plus, you can use ports, no need to mess with a seperate package manager (npm) and the associated package verification foibles.

> And if the system properly TRIMs it might not be necessary at all, though that greatly depends on the SSD.

The "depends on the SSD" is a big one. Various recent forensic papers have shown that it can take a while until a TRIM'd sector is actually erased by the firmware.

I still think that if this kind of thing causes worries, full-disk encryption is really the only sensible solution.

Re:Rm does not permanently delete files by masklinn on Thursday May 19, 2016 @10:05AM (#11730258)
> Sure, but installing (a subset of) GNU coreutils is probably going to pull in a lot fewer dependencies than this JavaScript command line tool.

No objection here. Though the original note is right, you just pointed to the wrong tool:

> I still think that if this kind of thing causes worries, full-disk encryption is really the only sensible solution.

And full agreement there.

Re:Rm does not permanently delete files by DannyBee on Thursday May 19, 2016 @10:52AM (#11730664)
"That's only true for GNU-based userlands, not BSD-based ones. "

  RM(1)                     BSD General Commands Manual                    RM(1)
...

  -P          Overwrite regular files before deleting them.  Files are
              overwritten three times, first with the byte pattern 0xff,
              then 0x00, and then 0xff again, before they are deleted.
Re:Rm does not permanently delete files by GalacticDomin8r on Thursday May 19, 2016 @10:41AM (#11730569)
> That's only true for GNU-based userlands, not BSD-based ones.

"rm -P" with the same caveats as the GNU implementation.

Re:Rm does not permanently delete files by Jaepa on Thursday May 19, 2016 @10:50AM (#11730652)
for BSD-base systems there is srm (secure remove), which overwrites, renames, & trucates before unlinking.

https://www.freshports.org/security/srm/

Re:Rm does not permanently delete files by wiredfool on Thursday May 19, 2016 @09:54AM (#11730168)
Looking at man shred, apparently one can shred stdout.
Re:Rm does not permanently delete files by brudgers on Thursday May 19, 2016 @03:16PM (#11732913)
"Shredding stdout" sounds like the highest complement for a command line utility.
Re:Rm does not permanently delete files by gcr on Thursday May 19, 2016 @11:15AM (#11730838)
Why not? One can shred any file descriptor. :-)

I bet one could even shred a network socket.

Re:Rm does not permanently delete files by emodendroket on Thursday May 19, 2016 @11:12AM (#11730823)
Is there any advantage to specifically disabling that?
Re:Rm does not permanently delete files by dTal on Friday May 20, 2016 @10:33AM (#11738069)
And yet it doesn't "work":

  dtal@reepicheep:~$ cat /dev/urandom | shred -
  shred: -: invalid file type
Re:Rm does not permanently delete files by colanderman on Saturday May 21, 2016 @10:23AM (#11744765)
Your command points stdin to the output of some random command. Even if you actually redirected stdout (pipe to cat, not from), it still wouldn't work, because cat's stdin isn't a file.

You need to point stdout to an actual file, like this:

    shred > /my/secret/file.txt
Why would you do this? At the end of a long batch of commands that all write to some temporary file opened on stdout. Not uncommon in shell-land.