LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-09-2005, 12:52 AM   #1
thrustan
LQ Newbie
 
Registered: Mar 2005
Posts: 15

Rep: Reputation: 0
Are delete files undeleted?


i am a former windows user. and when i delete files from the recycle bin, it can easily be recovered with the aid of a programme.

now, can this be done with linux? does linux delete my files for good or do they stay in my hdd and can be recoverd?
 
Old 03-09-2005, 03:31 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,

this is a complex question. if you use gnome/kde you can setup them to put the things that you erase in the trash - through a filemanager. but once you give at the terminal
Code:
rm $FILE
it is gone.
there are some apps that can recover but this is filesystem depedent also.
to get a complete and correct answer it is necessary a google tour.

regards

slackie1000
 
Old 03-09-2005, 07:32 AM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Also take a look at unSpawn's Security references thread, in particular post 5 has entire section of undelete tools and guides.
 
Old 03-09-2005, 12:57 PM   #4
Aeiri
Member
 
Registered: Feb 2004
Posts: 307

Rep: Reputation: 30
If the file is text only, there are methods you can use to retreive it.

You have to remember part of the file, say it contained "jahjoopisthespeakerforelmo". This would be a decent way to recover it, given that it had 100 lines, and resided on /dev/hda1. The results would have to be edited with an editor to clean up all the crap around it, though.

Code:
#!/bin/sh
linecount="100"
string="jahjoopisthespeakerforelmo"
partition="/dev/hda1"
outputfile="bobjones"

cat $partition | strings | grep -$linecount "$string" | tee $outputfile
Simple, but effective. I've used similar methods to bail me out of tight situations in the past
 
Old 03-09-2005, 01:06 PM   #5
Aeiri
Member
 
Registered: Feb 2004
Posts: 307

Rep: Reputation: 30
Oh, and if you want to securely delete something, or securely wipe a filesystem, this would be the method:

Code:
#!/bin/sh
filewipe="bobjones_file"
wipetimes="5"

stuff="/dev/zero /dev/urandom"
blah=""
i=1
while [ "$i" -le "$wipetimes" ]; do
  blah="$stuff $blah"
  let "i+=1"
done
blah=`echo ${blah:0:${#blah}-2}`

for wipe in blah; do
  dd if=$wipe of=$filewipe
done
Someone correct me if I'm wrong, I believe that using dd with only an input file and and output file will only go to the end of the output file and quit, correct?
 
  


Reply



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
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
how do you delete files? otoomet Linux - General 6 11-12-2004 04:06 AM
Delete Files imsajjadali Red Hat 15 07-23-2004 01:12 PM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM
Can't delete some files... Tomcat_cdm Linux - Newbie 2 03-11-2003 10:26 PM

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

All times are GMT -5. The time now is 10:42 PM.

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