LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-06-2004, 02:38 AM   #1
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
Logging off and locking out users at specific times


I need a way to log off a user at a specific time, and disable her account until a specific time. I could probally figure out how to make a script that would disable her account by editing the passwd file twice a day, but im not sure how to go about logging her out if she is already signed in. I thought about doing it by having the same script change the run level, but Id much rather not do that just to kick a user off a system.

Also, it would be perferable to have a five minute warning that she is going to be kicked off, so if she is actually doing anything important she can save her files.


This is to make a girl who spends way too much time on the slackware box im loaning her actually do her homework and go to bed, even if her parents arent home.


Any suggestions on where to start, or any programs that may make this easy?
 
Old 02-06-2004, 03:16 AM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
logoutd may be of use to you

man logoutd

man porttime
 
Old 02-17-2004, 01:03 PM   #3
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Original Poster
Rep: Reputation: 30
these services seem to work very niceley.

Thanks
 
Old 02-19-2004, 03:13 AM   #4
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Original Poster
Rep: Reputation: 30
ok... almoast there.

the only problem is that a reboot kills logoutd. Putting it in the rc file doesnt make it come up at boot time. any ideas?



from the man page:
logoutd enforces the login time and port restrictions
specified in /etc/porttime. logoutd should be started
from /etc/rc. The /etc/utmp file is scanned periodically
and each user name is checked to see if the named user is
permitted on the named port at the current time. Any
login session which is violating the restrictions in
/etc/porttime is terminated.


i tried creating a file in etc called rc and putting logoutd in it. doent come up at boot.

I tried doing whereis logoutd and putting the full path in the rc.local file (which starts my no-ip.com proggy)... that doesnt work either.



Typing logoutd as root works fine.... but a reboot will let the user back in by killing the service.

Ideas?
 
Old 02-19-2004, 08:45 AM   #5
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Add

/usr/sbin/logoutd

to the bottom of the /etc/rc.d/rc.M file or you could go the whole hog and use the syntax
the rc.M file uses

if [ -x /usr/sbin/logoutd ]; then
/usr/sbin/logoutd
fi
 
Old 02-19-2004, 02:21 PM   #6
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Original Poster
Rep: Reputation: 30
When I saw your name as the last poster i knew it would be fixed


Thanks, its working great now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Auto-login at specific times Vorik Linux - Software 6 12-11-2007 02:04 AM
squid + bandwidth cutoff at specific times of day avirup dasgupta Linux - Networking 2 09-01-2005 03:42 AM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 06:22 PM
Logging times in squid eantoranz Linux - Software 6 06-26-2005 06:16 PM
Video Capture at specific times from TV Tuner Card MasterC Linux - Software 1 03-19-2003 06:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration