From owner-freebsd-questions@freebsd.org Mon Feb 24 15:01:03 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A8B625F606 for ; Mon, 24 Feb 2020 15:01:03 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48R4y63Xdbz44V3 for ; Mon, 24 Feb 2020 15:01:02 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: by mail-qt1-x82b.google.com with SMTP id r5so6716313qtt.9 for ; Mon, 24 Feb 2020 07:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hPLwyg3pPihS3HkaFssfwroAUIvh6FymnD0qmsja2D0=; b=bVR/ZAUxEfpc5XmVZZG2IjyZ69k89CwH/SidKEyivjU69/pTH6SvqyAtnpEOGuwfhq PVmzQFHHYPYi2NZkfUeeNS4fKxNF+nYPHUDyyqYgchHWrVdW545+PS6F+kT0H3wBob/y k79kNuXU24xaCCWFXHzgt/fdo66BDBvvRvIM4Zc6RItO1gRzqniEMM28fdOwbaPMs43J PzNVPWoBEC9tq/YHQm3+M2XCEYGWMRZFl4rOCafQujlCXd3Qwh7yN3EERoesBl5w3zYb bfxEe3pjKN2Woj629tG81MvqmLrRsOXf8DjT9MVHfOVOgWJiTClZkGC+j9bg/B/exS/V ieHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hPLwyg3pPihS3HkaFssfwroAUIvh6FymnD0qmsja2D0=; b=Qwjnq70GWl0pP/+oiGDJJqP9pPreFbCyRo+pbcUyqc6OBVkLmV82g/Z3FbZL4M6c/P 1ygOwK4thijBoiEAt6r/x3erUla7zPqEUdnu50T1Rj+/5JD0GnXRNwyRBuNSQq0GYVXT rX8MCLmPErqFEMVPznkaXasIOMR/FpPwLAwVlvNul9d5MUa0WG56c4aNe01gDg9Q8W7H cuTx/BEQbAxThjcM9HVFx8zoyvrc2Y4xhiPAr2e9NuZSKS/0H42v+R+hzLCdEgbJ6BeR YqQsLiO6klURbnvaBYkoRwIJPeuQ/PdIuK5z6wuJTCy9KUr0T8h5RVd9FWPmy8DhT534 mF0g== X-Gm-Message-State: APjAAAWMPJjy0wG+SWROzw8Cdgxl8FG3bmksm0DhzHL/bcCrqCUZdP1Q G9ree4Mktfm3t/8PmXQHrE4LFOjcnTan5520AbAbSA== X-Google-Smtp-Source: APXvYqzzXBQl4nMfpZgo21/ikmyeZyvHtIUAvHnW18YzxSzqAs3qsdfButPefdGtevckF+7u41o+qrEbf/6qVtKtVug= X-Received: by 2002:ac8:1937:: with SMTP id t52mr46308436qtj.215.1582556461369; Mon, 24 Feb 2020 07:01:01 -0800 (PST) MIME-Version: 1.0 References: <20200223184908.b35d656a.freebsd@edvax.de> <20200224145317.GA9130@neutralgood.org> In-Reply-To: <20200224145317.GA9130@neutralgood.org> From: Michael Schuster Date: Mon, 24 Feb 2020 16:00:50 +0100 Message-ID: Subject: Re: rm | Cleaning up recycle bin To: "Kevin P. Neal" Cc: Polytropon , freeBSD Mailing List , Jos Chrispijn X-Rspamd-Queue-Id: 48R4y63Xdbz44V3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=bVR/ZAUx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of michaelsprivate@gmail.com designates 2607:f8b0:4864:20::82b as permitted sender) smtp.mailfrom=michaelsprivate@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[b.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-9.31), ipnet: 2607:f8b0::/32(-1.88), asn: 15169(-1.67), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 15:01:03 -0000 You also need to consider COW semantics when using ZFS: You'll never actually overwrite existing data, new data will be written to new disk blocks, so while the original data may not be visible to the user anymore with regular file system tools, depending on things like disk activity and how full the disk is, the old data you wanted overwritten may actually still be around on the storage media for a while. (I'd advise you to research "zfs" and "secure data removal" or something like that to find out what the current solution(s) to this problem is/are). HTH Michael On Mon, Feb 24, 2020 at 3:54 PM Kevin P. Neal wrote: > On Sun, Feb 23, 2020 at 06:49:08PM +0100, Polytropon wrote: > > On Sun, 23 Feb 2020 14:05:35 +0100, Jos Chrispijn wrote: > > > I read somewhere that using the rm command does not phsyically remove > > > the 'deleted' files when using the command in a terminal session. Can > > > you tell me how/where I can really remove these files (as per user > > > account or in general)? Thanks! > > > If you also want to remove the _data_ (read: the former file > > content), you need to overwrite the file's content with a > > random pattern or with zeros first. This can be done with > > the dd tool. There is also a port called "secure rm" (srm) > > that achieves the same "by overwriting, renaming, and > > truncating it before unlinking". You can find its manpage > > with further suggestions here: > > > > https://www.freebsd.org/cgi/man.cgi?query=srm > > > > However, this does not change things related to disk space > > becoming free. So when intending to simply remove files > > without any "recycle bin" nonsense, rm is the way to go. > > The thing about security is that often all you can do is raise the cost > of an attack. If the cost is high enough then you can often make an > attacker > find a better use of their time. > > Using forensics tools on a disk to recover a file that has been deleted > is pretty low cost. Still, I wouldn't expect the average street criminal > to be able to recover the files. The guy that broke into my house and > stole a jar of coins couldn't do it, for example. > > Filling the filesystem will probably clobber the leftover file's data > it's true. That makes an attack more expensive/harder, but if you are > using an SSD or a "shingled" (SMR?) hard drive then you aren't done yet. > > For example, SSD's will do wear leveling, and that means that a write to > a block at a particular offset will typically end up going to a different > physical block on the drive. The previous contents won't be available > to normal use, but tools no doubt exist that can recover the previous > block. > > So, what's the threat you are trying to protect yourself from? > -- > Kevin P. Neal http://www.pobox.com/~kpn/ > "Oh, I've heard that paradox a couple of times, but there's something > about a cat dying and I hate to think of such things." > - Dr. Donald Knuth speaking of Schrodinger's cat, December 8, 1999, MIT > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > -- Michael Schuster http://recursiveramblings.wordpress.com/ recursion, n: see 'recursion'