LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-20-2008, 11:26 PM   #1
jagavskyrproblem
LQ Newbie
 
Registered: Sep 2007
Distribution: Slackware 12.0
Posts: 7

Rep: Reputation: 0
Unhappy I want to lock myself out of my system for a set period of time


I want to be able to fairly easily lock myself out of my system for a set period of time.

I've been googling a lot, without success, so now I'm turning to you folks for help.

Thanks.

Last edited by jagavskyrproblem; 08-20-2008 at 11:32 PM.
 
Old 08-21-2008, 02:17 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
What's the reason for you wanting this, if I may ask?

If you have physical access to the computer it is fairly easy to break into. So I guess the easiest solution would be to lock the computer in a room and have someone else watch the key.
 
Old 08-21-2008, 07:25 AM   #3
jagavskyrproblem
LQ Newbie
 
Registered: Sep 2007
Distribution: Slackware 12.0
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kenneho View Post
What's the reason for you wanting this, if I may ask?
Lack of self control. As long as I have a computer nearby, I can't get much done.

I need my computer to be running, but inaccessible to myself.
 
Old 08-21-2008, 08:04 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
The easiest solution that comes to mind, provided you're not the kind to go and crack your own box, is to create a script that will lock your user (passwd -l user) and schedule a job for unlocking it (passwd -u user).

Yves.
 
Old 08-21-2008, 09:23 AM   #5
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Smile

Quote:
Originally Posted by jagavskyrproblem View Post
I want to be able to fairly easily lock myself out of my system for a set period of time.

I've been googling a lot, without success, so now I'm turning to you folks for help.

Thanks.
If you know how system works, then locking yourself out of the system is problematic if you have root account, because in this case you'll always find a way to disable your own lockout mechanism, no matter what it is it. There are a lot of possibilities (like calling poweroff with cron every 10 seconds during the period you don't want to access computer), but all this can be avoided by you if you have physical access to the computer, and if you have root account.

To my opinion, the only certain ways to keep you away from computer are following:
1) Give root account to someone else, not you, so this person will create some kind of lockout mechanic to keep you away from computer. This person should have strong intention to keep you away from computer, even you ask to grant you access again.
2) At the time you shouldn't access computer, go to some place without computers (go swimming. visit forest, zoo, join martial/fitness/dancing club, go jogging, walk around the town, or do some workout that'll make you too tired to use your PC.). Again, friend or famimly member might help here. And you can schedule system poweroff with cron at the time you should get up and go.
3) Try to find more interesting and healthly hobby.

Last edited by ErV; 08-21-2008 at 10:43 AM.
 
Old 08-21-2008, 11:12 AM   #6
jagavskyrproblem
LQ Newbie
 
Registered: Sep 2007
Distribution: Slackware 12.0
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theYinYeti View Post
The easiest solution that comes to mind, provided you're not the kind to go and crack your own box, is to create a script that will lock your user (passwd -l user) and schedule a job for unlocking it (passwd -u user).

Yves.
Thanks. I tried this.. but the old password still works on xlock and xscreensaver, not when I try to login though (of course.)

Quote:
Originally Posted by ErV
If you know how system works, then locking yourself out of the system is problematic if you have root account, because in this case you'll always find a way to disable your own lockout mechanism, no matter what it is it. There are a lot of possibilities (like calling poweroff with cron every 10 seconds during the period you don't want to access computer), but all this can be avoided by you if you have physical access to the computer, and if you have root account.
I figured that killing sshd, and running something like xlock/xscreensaver that had some sort of time lock would be sufficient. What theYinYeti suggested seemed like a great solution, so I'd like to know what's wrong.

And I'd like to stress again that I want my system to stay running.
 
Old 08-21-2008, 11:51 AM   #7
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Sounds to me like by far the best solution to your problem is self control. It's also the easiest to implement.

You will be able to overcome and restriction that you put in place by messing configuration/cronjobs/whatever and by trying to implement such a solution you're just inventing an excuse to use the computer some more. If you're really so lacking in self control that you cannot simply chose not to use the computer at certain times then you need to have someone else control physical access to your computer and possibly seek professional help for your addiction.

If it's a problem of not being able to fill your time with other things then go for a walk at least half an hour a day. It's free, easy and it's good exercise. If you find just walking is too boring, and why wouldn't you, get some sort of mp3 player and find some good podcasts to listen to whilst you walk.

Now stop messing around using your computer to try to work out how to stop yourself using your computer and go do something else!

Just sayin'...
 
Old 08-21-2008, 12:03 PM   #8
jagavskyrproblem
LQ Newbie
 
Registered: Sep 2007
Distribution: Slackware 12.0
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by arizonagroovejet View Post
Now stop messing around using your computer to try to work out how to stop yourself using your computer and go do something else!
But I'm so close now! I just need a C programmer to modify this program so that it will read the password again when it's time to unlock: http://code.suckless.org/dl/tools/slock-0.9.tar.gz
 
Old 08-21-2008, 12:05 PM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
If you're in control of locking yourself out, then you have the control to unlock yourself. What your asking isn't really going to stop you if you really want to get on the computer. I'd agree with arizonagroovejet, learn some self-control. If you can't help yourself, find someone who can help you. Get a new hobby, girlfriend/boyfriend, whatever!
 
Old 08-21-2008, 12:13 PM   #10
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by jagavskyrproblem View Post
I figured that killing sshd, and running something like xlock/xscreensaver that had some sort of time lock would be sufficient. What theYinYeti suggested seemed like a great solution, so I'd like to know what's wrong.
*sigh*. You really want to know how to break your protection from yourself? Here you go. You can always kill X with ctrl+alt+backspace, so you'll be able to log in again. If you can't login again because you are locked out, then you can log in as root via terminal, and unlock yourself. If you can't log in as root (I doubt that), then, because you have access to hardware you can always boot livecd and modify system data by hand. If you can't figure out how to modify configuration, you can reinstall whole system while keeping important data intact. If you can't enter bios (to boot LiveCD) because it's protected by passwords, then you can reset CMOS, remove battery, or find factory password. If you make script which shutdowns computer when you shouldn't be using it (script is run at system startup and every 30 seconds by cron), then you can always log in as root or boot livecd and delete that script.
Or you can wait a day and disable protection at the time you actully can use computer.

To my opinion, trying to lock yourself out of computer where you are root(and have physical access to machine) is hopeless, because there will be always a way to disable that lockout, and in the end you'll be spending more time with computer trying to find that way.

Really, try non-computer solutions I've listed before.

Quote:
Originally Posted by trickykid View Post
Get a new hobby, girlfriend/boyfriend, whatever!
One of the best solutions, I think. Seriously.

Last edited by ErV; 08-21-2008 at 12:22 PM.
 
Old 08-21-2008, 12:17 PM   #11
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by ErV View Post
To my opinion, trying to lock yourself out of computer where you are root(and have physical access to machine) is hopeless, because there will be always a way to disable that lockout, and in the end you'll be spending more time with computer trying to find that way.
I think of it this way. What the OP is asking is kind of like a drug addict locking his drugs in a cabinet and throwing the keys up on the roof of his house, having a ladder readily available in his garage.
 
1 members found this post helpful.
Old 08-21-2008, 12:22 PM   #12
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Pull the power cord, throw it in the trunk of your car, and park your car two blocks away. The effort of having to retrieve the cord will discourage you from using your computer for trivial purposes during "lockdown" periods.
 
Old 08-21-2008, 12:29 PM   #13
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by anomie View Post
Pull the power cord, throw it in the trunk of your car, and park your car two blocks away. The effort of having to retrieve the cord will discourage you from using your computer for trivial purposes during "lockdown" periods.
No, give it to a friend to keep. Two blocks away is not far, two miles isn't that far even. If they really can't keep themselves away from a computer with self control, they should seek help.
 
Old 08-21-2008, 12:31 PM   #14
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by trickykid View Post
I think of it this way. What the OP is asking is kind of like a drug addict locking his drugs in a cabinet and throwing the keys up on the roof of his house, having a ladder readily available in his garage.
The best solution really is to sell computer or to live a month with some distant relatives (preferably living in the farmlands without computers), or to find a girlfriend/hobby. I'd recommend girlfriend.

Another possible solution is to find an extremely boring job where you'll have to use computers a lot solely for the purpose of work. In this case there'll be chance that after a month you'll hate computers and everything associated with them.

Last edited by ErV; 08-21-2008 at 12:55 PM.
 
Old 08-21-2008, 12:45 PM   #15
jagavskyrproblem
LQ Newbie
 
Registered: Sep 2007
Distribution: Slackware 12.0
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

Hehe. Lots of amusing replies... But I think I've found a good enough solution. I'll use 'passwd -l' and '-u' with slock, and ssh in from my eee 900 when it's time to unlock (root access via sshd is off). As I've said before, rebooting is not an option, and neither is shutting down, as I have things running. And using the eee for the same purposes as my main computer is not satisfying enough to replace it. I hope I've made sense ...
 
  


Reply

Tags
lock



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set and sync system time with time server?? servnov Linux - Newbie 6 12-03-2013 07:55 PM
i need to lock my keyboard and mouse for a short period of time and also unlock them balajitrz Linux - Hardware 3 02-16-2007 12:46 PM
i need to lock my keyboard and mouse for a short period of time and also unlock them balajitrz Linux - Hardware 1 02-16-2007 01:00 AM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:54 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