• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Any simple tools

Are you trying to restrict logging on to the system completely?

Time limiting after login?

Or do you just want to kill certain features at a given time?

I don't have the answer, but do you have some scenarios that you could share to give others a better idea of exactly what it is you are trying to accomplish?
 
I want to allow my kids to log on only certain times of day. Windows 7 had a utility that allowed me to set the times they were allowed to be logged on. I am looking for something similar
 
Seems like the easiest tool is a text editor... (isn't that often the case in linux? 🙂 )

My search led to the same techrepublic article that you are looking at...

Seems pretty easy to edit the text file and add the users that want to restrict.

I found some more that may describe it better... but it is the same content...

http://serverfault.com/questions/139789/how-can-i-limit-the-login-times-in-linux-for-certain-users

http://superuser.com/questions/467811/how-to-restrict-user-from-login-saturday-and-sunday

https://ask.fedoraproject.org/quest...triction-with-pam-a-kind-of-parental-control/

I was just able to do this in about 5 minutes for a user I created using all graphical tools...
 
Last edited:
I'll admit defeat... I can't seem to figure out where I'm going wrong, but maybe someone here can help... I must be missing something...

Here is what I did....

Created a new user with a standard account. We'll call them "user".

Edited /etc/pam.d/login and uncommented the line for pam_time (i.e., account required pam_time.so)
Edited /etc/security/time.conf and added *;*;user;!Mo1300-1900

In theory, I thought that should prevent me from logging on mondays from 1pm to 7pm.

However, I was still able to log on with that user during that timeframe.

I'm not sure what I'm missing...

Maybe someone else here can help?
 
This is bugging me now...

You have my word that I will figure it out one way or another tonight... it is an extremely useful feature... I didn't use it before, but now I want it!

🙂
 
I'll admit defeat... I can't seem to figure out where I'm going wrong, but maybe someone here can help... I must be missing something...

Here is what I did....

Created a new user with a standard account. We'll call them "user".

Edited /etc/pam.d/login and uncommented the line for pam_time (i.e., account required pam_time.so)
Edited /etc/security/time.conf and added *;*;user;!Mo1300-1900

In theory, I thought that should prevent me from logging on mondays from 1pm to 7pm.

However, I was still able to log on with that user during that timeframe.

I'm not sure what I'm missing...

Maybe someone else here can help?
Reading the last link that you posted above, it seems that you can only login at the times that you specified (Mondays 1pm to 7pm).
 
Reading the last link that you posted above, it seems that you can only login at the times that you specified (Mondays 1pm to 7pm).

I tried it multiple ways....

My understaning is that ! (NOT) meant I could do everything as long as it was NOT in that timeframe.

*;*;user;!Mo1300-1900

user can not do anything on Mondays from 1300-1900

*;*;user;Mo1300-1900

user can only do anything on Monday from 1300-1900

I tried it with and without the ! operand. I was able to login in both instances...
 
Now that I'm reading some more... I'm wondering if I need to enable pam_time in additional modules...

Is it because Ubuntu uses GDM to log in? Maybe I need to make the change there too?

I'll have to try that when I get home today.
 
Ok... I feel like such a rookie... never used PAM, but I got it working.

Here is what I did.

1. Log in with your main account
2. Launch a Terminal window
3. Type the following

Code:
sudo nautilus

Enter your password and a root file manager should open.

3. Browse to the pam.d folder (computer/etc/pam.d)
4. Double click on the "login" file
5. Uncomment (remove the # ) from the line that reads "account requisite pam_time.so"
6. Save the file.
7. In the same directory open the lightdm file
8. To the end, add the line

Code:
account required pam_time.so

9. Save the file
10. With the same sudo file broswer, navigate to computer/etc/security
11. Open the time.conf file
12. To the end of the file, add the restrictions that you want.

*;*;user;!Wk1500-2000

for instance will not (!) allow a user to log in on weekdays between the hours of 3pm and 8pm

*;*;user;Wk1500-2000

will allow user to only log on during those times.

You could also do multiple users by using the or operand (|)

For example... if you wanted both your kids to have the same login restrictions... you could do it in a single line

*;*;user1|user2;!Wk1300-2000

If you tell us some more about the restrictions you want, I bet we could help you edit the time.conf file.

The only weird thing that I noticed is that it stops me from logging on... but it tells me my password is incorrect. I would like it more if it gave me a more descriptive error and told me that I wasn't permitted to log in at that time.

Hopefully that helps.

It seems that the key I was missing was to edit the lightdm file... Ubuntu 13.10 uses that for the initial login.
 
Just a bit of clarification. Instead of using
Code:
sudo nautilus
The gksu package should be installed and nautilus should be ran like this.
Code:
gksudo nautilus
It is my understanding from reading here and there that sudo may not set permissions for graphical applications correctly and may cause problems.

Edit: Good job on the research though. :thumbsup:
 
Back
Top