5
0
Essentially, what I need is some way to generate and store a random string (20 characters long, say) for some period of time, such that there is no way for me to recover the string until the end of that period. I am running standard Ubuntu 12.10.
Things that make this hard:
- I have root access.
- The computer might shut down and start up during the period.
- There needs to be no way for me to recover the string before the period ends.
- I'll have no internet access for the duration of the period.
The reason I need to do this is that I have an addiction to internet porn. Most of the time I can control it, but I get cravings late at night. This is even harder because I use a computer for my work and I work from home. So lately I've started removing /sbin/dhclient, which disables internet connectivity (until I can get a liveCD and copy the file back, but that takes a while). What I want to do instead is to generate a password for dhclient (by encrypting dhclient, or just creating a zipfile with that password), and then only have the password given back to me the next morning. Basically I'm trying to find a commitment device, a bit like an alcoholic pouring his liquor into the sink.
Some possible avenues of attack:
- Run a program that generates the string and stores it in memory, waits for n seconds, then prints the string. This won't work because the process would be killed if the computer restarted, and I might look in the program's memory to find the string.
- Let the program change the root password to the randomly-generated string, removing root access from me; let it store the string in a file that only root has r/w access to, and let root repeatedly run a program which checks whether the period is over, and if so, give me the string (and thus root access). This sounds like it would work, but I can get around it by changing the time in the BIOS.
- An idea I just had: write one program that removes root access and stores the password in a file that requires root to read. Then let root use cron to run a program every minute that checks for the existence of a file called "delayed_root_request". Every time it runs, if delayed_root_request exists, it increments a number stored in a "root_timer" file that only root can read/write. (If that doesn't exist, it creates it and makes it contain "0".) When the number in root_timer reaches something like 60*8=480, it gives me read access to the file that stores the root password and thus root access. So I can run a script that removes root access, stores the randomly-generated password in a root-access-only file, and breaks dhclient. When I want internet access back, I create the file "delayed_root_request" and have to wait 8 hours for the password. If at any time during those 8 hours I decide root access would just make me procrastinate, I just delete the file and I have to start the count over. If the computer restarts, the counting just pauses. I'd have to give GRUB a password (e.g. http://sourceforge.net/projects/grubpass/). I can still get in with optical media, or just taking out the hard drive, but I can make that inconvenient by deleting all copies of the Ubuntu iso file that I have, and I can give away all my liveCDs (and won't be able to make more without internet access).
There might be a really easy way to do this that I'm missing - please tell me any ideas you have.
Any help with this will really be appreciated!
Seems like a simple shell script would do the trick. You might want to ask stackoverflow.com for unix shell script ideas. – Ben Plont – 2013-07-12T22:12:02.437
2Sounds like you need a good accountability partner, someone who will absolutely work to keep you honest. The problem with this kind of thing is there will always be a way around it if you want it bad enough. If I were in your situation, I would probably have a friend set-up your router with filtering and password protect it (use OpenDNS or manual settings, either way). They would be able to tell if you had changed it as their username/pass would be gone from the router. Again, you could get around that too. This ultimately comes down to self control, which is something learned. – nerdwaller – 2013-07-12T22:16:20.457
5This is a social problem, not a technical one. Finding a technical solution to it will be very difficult, if not impossible. Any restrictions you set, you can also undo because you have complete control over your hardware. I doubt that you'll find a working solution unless you can remove yourself from control, and require that someone else hold you accountable until you can hold yourself accountable. – Darth Android – 2013-07-12T22:21:17.733
2I dunno. There are technological solutions to social problems everywhere you look (the Pill, gastric bypasses, online dating services, police forensics, the telephone, disulfiram, etcetera). Accountability partners would be great, but I don't want to tell my close friends that I have a porn addiction. – Stephen – 2013-07-12T22:49:45.797