Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all, It is possible to make a system setting somewhere or install code so that when a file is deleted or moved, regardless of how, ie: using any means ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    25

    Question how to Securely delete files

    Hi all,


    It is possible to make a system setting somewhere or install code so that when a file is deleted or moved, regardless of how, ie: using any means a shell cmd or a desktop application, the file is securely deleted?

    I typically use gnome desktop and when I delete a file I want to know for certain it has been deleted, erased, all data gone... etc.

    While I am aware of shred, it's cmd line only and doesn't apply to my question.

    I want to have any file that is being deleted or moved to wipe the source disk areas.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    I would think that any window, gnome, kde, ect., would make a call to 'rm' when you are deleting a file. I'm not a programmer but why re-invent the wheel when it's already on the system? I'm sure if this is not correct someone will point that out.

    That being said, if you like the way 'shred' does it's thing then why not substitute 'shred' for 'rm'? There are a couple of ways you could do this.

    You could create an alias in /etc/backrc (best option)
    You could replace 'rm' with 'shred' (take a lot of care here so that you can back out if you want to)
    (when I say replace I'm talking moving rm to rm.org and the coping shred to rm)

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    I'll agree with Robert,using alias with shred is the best choice.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    Sorry, but no.

    Replacing rm with shred will only work for a few shell scripts.
    And only if shred would have the same and all options of rm (haven't checked).

    Everything else, like perl, python, C-programms, etc will NOT call rm to delete files,
    but rather do a systemcall to the linux virtual file system.

    rm also does this, btw.


    That said, a "secure" delete would be a task for the underlying filesystem, ie: ext3, xfs, etc.
    But I am not aware of such a mount option or feature.
    You must always face the curtain with a bow.

  5. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Quote Originally Posted by Irithori View Post
    Replacing rm with shred will only work for a few shell scripts.
    And only if shred would have the same and all options of rm (haven't checked).
    shred alias will be useful while invoking rm command from scripts or applications which depends on rm command instead of using unlink sys.call directly.

    Quote Originally Posted by Irithori View Post
    Everything else, like perl, python, C-programms, etc will NOT call rm to delete files,
    but rather do a systemcall to the linux virtual file system.
    Irithori,what you have said is true,it mostly depends on application - How it handles the delete functionality - by invoking system call unlink directly or invoking rm command which will use unlink sys.call.

    That said, a "secure" delete would be a task for the underlying filesystem, ie: ext3, xfs, etc.
    But I am not aware of such a mount option or feature.
    I may wrong ,but as far I know, ext3 don't have such secure delete functionality by default.
    You could try tools like Darik's Boot And Nuke | Hard Drive Disk Wipe and Data Clearing but they wipe out entire HD
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Irithori, thnx for the information. As stated I'm not a programmer so this is something I didn't know. But for normal use replacing RM with SHRED will work.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...