LinuxQuestions.org
Visit Jeremy's Blog.
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 09-04-2006, 12:44 PM   #1
vegetassj2
Member
 
Registered: Jan 2005
Posts: 201

Rep: Reputation: 30
Automatic Log Off


hi,

Is there such program in linux that does the following:

User A logs on...
Time User A: 2hours
1.5 hours later;
User A logs off...
User B logs on...
Time User B: 1 hour
1 hour later;
User B automaticly gets logged off.
10 min later;
User A logs on...
0.5 hours later;
User A automaticly gets logged off.

?
Short: Is it possible to give a user just a limited time to stayed loged on? Can the 'timer' be saved when the user logs off within the time limit?

thanks
 
Old 09-04-2006, 03:14 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That can be done - the question is how much time do you want to
spend on it.


Cheers,
Tink
 
Old 09-04-2006, 06:39 PM   #3
sixgunz2
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
(Jeeze some of the answers tonight are ambiguous at the least!!!)

The best way is to have something execute as the user logs in...

Have a countdown daemon running and at 0 get it to send the command "exit" - you might have to sudo the command as root.

Havent tried it, but something like:




#!bin/sh
counter = 0

while ((counter < 72000))
do
(( counter++ ))
sleep 1
done

echo <root password> | sudo -S exit



Invoke it as the user logs on like this:

countdown_to_logoff.sh &

The & at the end will cause the script to run in the background!

Last edited by sixgunz2; 09-04-2006 at 06:40 PM.
 
  


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
Automatic log-out? x86processor LQ Suggestions & Feedback 5 06-30-2006 08:25 AM
no automatic shutdown after kde log-out stevielawson Slackware 11 01-10-2006 04:58 PM
Automatic log in and starting programs at boot Spy47 Linux - Newbie 3 11-18-2004 05:17 PM
log in and out automatic user ronty Slackware 6 06-24-2004 06:49 PM
Automatic log out? xwastedmindx Linux - General 3 08-20-2003 06:51 PM

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

All times are GMT -5. The time now is 02:36 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
Open Source Consulting | Domain Registration