| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-04-2009, 10:03 AM
|
#1
|
|
Member
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798
Rep:
|
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.
|
|
|
|
12-04-2009, 10:51 AM
|
#2
|
|
Senior Member
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833
Rep: 
|
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.
|
|
|
|
12-04-2009, 11:40 AM
|
#3
|
|
Member
Registered: Feb 2009
Location: Iowa
Distribution: Ubuntu 9.10
Posts: 164
Rep:
|
Quote:
Originally Posted by tkmsr
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.
|
12-17-2009, 11:01 PM
|
#4
|
|
LQ Newbie
Registered: Nov 2009
Location: China
Distribution: Ubuntu, openSUSE, Debian, Fedora
Posts: 3
Rep:
|
Quote:
Originally Posted by rweaver
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:44 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|