LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-04-2005, 01:36 PM   #1
Trio3b
Member
 
Registered: Oct 2004
Location: Texas, USA
Distribution: MDV 2008.1, PCLinuxOS,
Posts: 315

Rep: Reputation: 30
shred allows only one file


Selling PC and would like to delete old files. Have been using following:

shred -vxn 5 <file>
or
shred vuxn 5 <file>

where v-verbose
x -exact file size
n 5 - number of shreds
u-remove file

Have also tried f to force, but after first file receive permission denied. If I delete individually all is OK. This will take too long. Is there a way to instruct to shred a group of files?

Any help appreciated
Thanks
 
Old 12-04-2005, 05:46 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You could use something like DBAN and clean the whole partition at once.
 
Old 12-05-2005, 12:59 PM   #3
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
You could write a shell script to pass each file to shred:
Code:
#!/bin/bash

shredfiles="/path/to/file1 /path/to/file2 /path/to/file3"
for f in $shredfiles; do
  shred vuxn 5 $f;
done
I don't consider 5 overwrites to be secure. Usually I run shred with -vzu flags.
Also read other threads on the forum that would be helpful -- http://www.linuxquestions.org/questi...d.php?t=363951
 
Old 12-05-2005, 09:48 PM   #4
Trio3b
Member
 
Registered: Oct 2004
Location: Texas, USA
Distribution: MDV 2008.1, PCLinuxOS,
Posts: 315

Original Poster
Rep: Reputation: 30
shred files

This may do the trick as I don't want to shred the whole disk or device (as shred is supposed to do). Just the files which are non critical financial stuff. Still a CL newb and never written a script before - Am assuming this will be entered in console as root?
Is there a quick way to list all the files (about 30 or 40)? Cut 'n paste? Would you mind explaining what each command is doing so I learn something?

Thanks

Last edited by Trio3b; 12-05-2005 at 09:50 PM.
 
Old 12-05-2005, 11:46 PM   #5
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Look for a common pattern in your files (eg: they are all *xls files). It will be helpful if you can put them all in the same directory (eg: ~/shred).
Code:
mkdir ~/shred
cd dir1/
mv *xls ~/shred
cd ../dir2
mv *xls ~/shred
cd ~/shred
for i in `ls *xls`; do
shred -vzu $i;
done
What we've done is:
1. Created a directory (~/shred)
2. Moved our files to it (mv *xls ~/shred)
3. Changed our current working directory to the shred directory (cd ~/shred)
4. Iterated through the directory listing (for i in `ls *xls`; do)
5. Shredded each file (shred -vzu)

hth
 
Old 12-08-2005, 12:58 AM   #6
Trio3b
Member
 
Registered: Oct 2004
Location: Texas, USA
Distribution: MDV 2008.1, PCLinuxOS,
Posts: 315

Original Poster
Rep: Reputation: 30
shred

Thanks, will give that a shot this weekend.

Hmm.. unfortunately the files are of different types such as scanned tiff, and openoffice writer and calc docs, but I guess I could do them as groups, however when I do the :
for i in *TIFF; do shred -vzu $i;

I delete my '/etc/profile.d/xhost/sh' file and the TIFF file is still there. Must have syntax wrong.

Last edited by Trio3b; 12-09-2005 at 12:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why does the new version of kgpg shred so fast? darksmiley Linux - Security 7 04-23-2006 03:02 PM
shred folder from konsole illtbagu Linux - General 6 05-06-2004 09:39 AM
shred program for ext3 elconde Linux - Software 4 11-24-2003 06:08 PM
Bootdisk with Shred or dd for Alpha bretticus Linux - Newbie 0 11-11-2003 10:22 PM
what is meant by shred? murshed Linux - Newbie 5 04-13-2003 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration