LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-04-2009, 10:03 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
Disable user login after certain time of day


I want to know how can some one disable user login after certain time of day upto certain time that is lock the screen for some time.
 
Old 12-04-2009, 10:51 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
I don't know of any method to perform this kind of operation without customizing things a bit. For example you could use scripts to disable certain accounts at a certain time and re-enable them at a later time via crontab.

# m h dom mon dow command
0 18 0 0 0 cp /etc/shadow.nopasswd /etc/shadow
0 8 0 0 0 cp /etc/shadow.withpasswd /etc/shadow

You could also probably use account expiration to disable enable logins through a scripted process.
 
Old 12-04-2009, 11:40 AM   #3
Jim Bengtson
Member
 
Registered: Feb 2009
Location: Iowa
Distribution: Ubuntu 9.10
Posts: 164

Rep: Reputation: 38
Quote:
Originally Posted by tkmsr View Post
I want to know how can some one disable user login after certain time of day upto certain time that is lock the screen for some time.
Use PAM and the pam_time module:

Quote:
The pam_time PAM module does not authenticate the user, but instead it restricts access to a system and or specific applications at various times of the day and on specific days or over various terminal lines. This module can be configured to deny access to (individual) users based on their name, the time of day, the day of week, the service they are applying for and their terminal from which they are making their request.
 
1 members found this post helpful.
Old 12-17-2009, 11:01 PM   #4
William.Herry
LQ Newbie
 
Registered: Nov 2009
Location: China
Distribution: Ubuntu, openSUSE, Debian, Fedora
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by rweaver View Post
I don't know of any method to perform this kind of operation without customizing things a bit. For example you could use scripts to disable certain accounts at a certain time and re-enable them at a later time via crontab.

# m h dom mon dow command
0 18 0 0 0 cp /etc/shadow.nopasswd /etc/shadow
0 8 0 0 0 cp /etc/shadow.withpasswd /etc/shadow

You could also probably use account expiration to disable enable logins through a scripted process.
passwd -l username
passwd -u username
 
  


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
Allow a user to use gaim only at a certain time of the day Menestrel Linux - Security 5 07-04-2005 12:30 AM
Changing a user's group at login depending on the time of day Steve2001 Linux - General 10 10-11-2004 03:29 AM
Limit time for a user per day davholla Linux - General 11 08-22-2004 02:14 PM
contrlling login by day and time starx Linux - General 1 12-07-2003 03:24 PM
first time linux user, frist day with mandrake9.1 on my system. Sabastian Linux - Newbie 4 06-18-2003 02:35 AM


All times are GMT -5. The time now is 11:48 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration