You are not logged in.

#1 2005-12-29 14:28:30

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Purposely making a file difficult to edit, even for root

Is there a way of making a file really difficult to edit, even for root? I wanna stop myself accessing certain sites, like bittorrent trackers etc, and I edit /etc/hosts to redirect these sites to localhost, but I keep just editing this file and commenting out ones when I desperately wanna go look for something (lack of willpower or what *sniff*).

Any ideas?


.oO Komodo Dave Oo.

Offline

#2 2005-12-29 14:40:33

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: Purposely making a file difficult to edit, even for root

Setup a script+cronjob that'll overwrite the file with a default every second? I don't think you can set permissions so that root can't write to it and then if you could, that wouldn't be smart because you could never edit it if you needed to.

Offline

#3 2005-12-29 14:51:44

kleptophobiac
Member
From: Sunnyvale, CA
Registered: 2004-04-25
Posts: 488

Re: Purposely making a file difficult to edit, even for root

Have someone else block it on your router and not give you the root password.

Offline

#4 2005-12-29 15:58:52

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Purposely making a file difficult to edit, even for root

1) Setup SELinux or similar mandatory access controls
2) Lose your root password
3) Seek counseling, and learn to say "no" to yourself


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2005-12-29 16:23:54

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Purposely making a file difficult to edit, even for root

cactus wrote:

2) Lose your root password

I do that on purpose and just 'sudo su'...

I'd vote for blocking on the router

Offline

#6 2005-12-29 16:34:14

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Purposely making a file difficult to edit, even for root

Blocking on the router would be a great plan, but I don't have one, sadly...

Maybe if I get the banned sites' IPs, and put those into /etc/hosts, then randomize their ordering... then it'd be a real arse for me to find the correct one to unblock. I could add some random IPs in there too, to bulk it up (and hope that none of the random IPs corresponds to slashdot or gizmodo wink)


.oO Komodo Dave Oo.

Offline

#7 2005-12-29 16:49:22

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: Purposely making a file difficult to edit, even for root

do you know iptables? if not you could have someone block it there for you. then you'd have to go learn iptables to unblock it, and that's enough to deter most anyone. tongue

Offline

#8 2005-12-29 17:17:46

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Purposely making a file difficult to edit, even for root

slackhack wrote:

do you know iptables? if not you could have someone block it there for you. then you'd have to go learn iptables to unblock it, and that's enough to deter most anyone. tongue

No I don't slackhack... that's a pretty cool idea. I could get them to write a script that would let me add a site, but not remove it.

Volunteers?

Only kidding tongue


.oO Komodo Dave Oo.

Offline

#9 2005-12-29 19:59:32

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Purposely making a file difficult to edit, even for root

You could just cancel your internet service... problem solved big_smile

** we need a smart ass comment smiley **

Offline

#10 2005-12-29 20:23:56

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Purposely making a file difficult to edit, even for root

rofl, now THERE'S an idea.

That means this is my last thread ever.

/me has left the building.


.oO Komodo Dave Oo.

Offline

#11 2005-12-29 21:48:05

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: Purposely making a file difficult to edit, even for root

Just watch the porn Komodo.

:twisted:

Sorry.  I had to say it.  I say do the router thing.  It's a hassle to change things like that, and maybe thit will be enough to stop you.

Offline

#12 2005-12-29 21:56:30

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Purposely making a file difficult to edit, even for root

codemac wrote:

Just watch the porn Komodo.

Hehe, well, fortunately that's not a problem... I'm on a monitored network, but there's only so much string searching URLs can reveal  tongue

codemac wrote:

I say do the router thing

Tut tut tut - I quote:

Komodo wrote:

Blocking on the router would be a great plan, but I don't have one, sadly...

*shakes head* I don't know... lack of attention OR WHAT  tongue


.oO Komodo Dave Oo.

Offline

#13 2005-12-30 05:22:11

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Purposely making a file difficult to edit, even for root

If its not porn, and its forum addiction, ask the admins to disable or block your account.

Worked a treat for me tongue

No matter what you can do, you can undo it somehow, and you arent going to do anything you cannot undo somehow, so theres no solution you can do for yourself.

Offline

#14 2005-12-30 11:42:33

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Purposely making a file difficult to edit, even for root

iphitus wrote:

No matter what you can do, you can undo it somehow, and you arent going to do anything you cannot undo somehow, so theres no solution you can do for yourself.

Damn your infallible logic iphitus tongue

No seriously, I like that iptables idea; I might get someone to do that. Or I could write a script myself to add an IP, but not write a script to remove one.


.oO Komodo Dave Oo.

Offline

Board footer

Powered by FluxBB