maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   script to wipe all sensitive user data - guinea pigs (/lemmings) wanted, apply within! (https://talk.maemo.org/showthread.php?t=69518)

festivalnut 2011-02-08 16:26

script to wipe all sensitive user data - guinea pigs (/lemmings) wanted, apply within!
 
in my alternate life as an international man of mystery i may at some point have to wipe all my data in an emergency, i know there is a short xterm code to completely erase everything, but i want the phone to still be usable, i was just wondering if there is a xterm code that will wipe all user data but leave the os intact? then i can queen beecon it and if the commies catch me i can hit the button and nobody has to die. yet.

p.s. this post will self destruct in 3hours.

Captwheeto 2011-02-08 16:31

Re: xterm command to wipe all user data?
 
What kind of things did you want deleting? I don't think there's a one-stop-delete-everything-in-a-usable-way command, but it's certainly scriptable.

festivalnut 2011-02-08 16:35

Re: xterm command to wipe all user data?
 
basically everything i've put on there, call records, texts, images and videos, im, gps history. if its scriptable it may be good to not delete my apps and saves etc, but definately anything that could lead the enemy to my secret volcano safehouse... oops, i've said too much already!

jstokes 2011-02-08 16:41

Re: xterm command to wipe all user data?
 
Start with the "Clear device" function already found in Settings. It runs a script: /usr/sbin/osso-app-killer-cud.sh

It doesn't clear everything (esp. settings in ~ by applications created by a 3rd-party, for instance) but it just runs a bunch of scripts in /etc/osso-cud-scripts/

festivalnut 2011-02-08 16:47

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by jstokes (Post 939129)
Start with the "Clear device" function already found in Settings. It runs a script: /usr/sbin/osso-app-killer-cud.sh

It doesn't clear everything (esp. settings in ~ by applications created by a 3rd-party, for instance) but it just runs a bunch of scripts in /etc/osso-cud-scripts/

thanks, i'm guessing i'd want to edit this to my own settings, so it clears what i want it to, but obviously i'm a bit dubious about how to safely open and edit it, i dont want to accidentally run it prematurely! any tips for playing with this particular fire safely?

ps would a rm /home/user/MyDocs/ command work as root or is it somehow protected? again, testing isn't really an option!

Captwheeto 2011-02-08 16:49

Re: xterm command to wipe all user data?
 
Should work... you should definitely test it though to make sure ;)

jstokes 2011-02-08 16:53

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by festivalnut (Post 939133)
thanks, i'm guessing i'd want to edit this to my own settings, so it clears what i want it to, but obviously i'm a bit dubious about how to safely open and edit it, i dont want to accidentally run it prematurely! any tips for playing with this particular fire safely?

No? :D

I guess you'd have to go through the scripts and try and figure out what's being deleted. If you have the time, you could use RobbieThe1st's BackupMenu to create a clone of your rootfs and see what gets deleted...

Quote:

ps would a rm /home/user/MyDocs/ command work as root or is it somehow protected? again, testing isn't really an option!
It should work as anyone: MyDocs is just a FAT32 partition with no understanding of UNIX permissions. Though you'd want to make sure that it's error-free so that it's not mounted as read-only! You'd also want to add a "-r" (maybe an "-f" also?) to your rm command so that it deletes subdirectories too

festivalnut 2011-02-08 16:54

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by Captwheeto (Post 939135)
Should work... you should definitely test it though to make sure ;)

no thanks for you this time captain wheeto! if it wasn't so recently that i had to repopulate my n900 after i got it back from nokia i may be willing to go through all the hassle, but not again so soon!

would this remove the contents of MyDocs, or the actual MyDocs folder itself? and would the n900 create a new MyDocs folder or is it reflash time if that goes?

festivalnut 2011-02-08 17:02

Re: xterm command to wipe all user data?
 
i think what i'll do is try writing a little script and then bring it back for you all to have a look and either approve or show me the error of my ways, is there a command to delete all sub directories like you mentioned but leave the parent folder alone?

and just to save me some homework does anyone know off the top of their heads the locations of:

saved texts
saved im
call records
fmms images
web bookmarks
web history
cache
saved passwords etc.

Captwheeto 2011-02-08 17:08

Re: xterm command to wipe all user data?
 
Bwaahaaha.

Anyway, that would delete the directory + everything in it (if it was rm -r).
If you wanted to keep the folder but delete the contents you'd do

rm -r /home/user/MyDocs/*

But why make it easy for them to get your super secret volcano hideout? (Ps. I know where it is)

#!/bin/bash
for ((a=0;a<3;a++))
dd if=/dev/zero of=/home/user/MyDocs
done


All times are GMT. The time now is 14:28.

vBulletin® Version 3.8.8