Jump to content

Keeping track of online time


rolanaj

Recommended Posts

I am trying to limit the amount of time my son spends online, he'll stay there all day if I don't stop him. Is there any program I can use to track how much time he is logged into the internet each day? I know I can change the password and then I have to be here to let him online, but I kind of want to let him be responsible for his online time. I use Mandriva Spring and we are on dial up. Any suggestions anyone?

Link to comment
Share on other sites

I do not know of software that does this monitoring for you, but I am sure it is available and maybe even in the repositories.The only thing I know is that you can give the command "w" and it will show you what user has been logged in for how log with the exact time. ( but rebooting resets the time :lol: )BUT if it is the online-time ( connected ) you want to monitor: kppp has a log with exact times your computer was connected and how many MB was transferred.:lol: Bruno

Link to comment
Share on other sites

hi rolanajI read this post 3x, i am curious why you would want to log his time sure you can create logs and keep track if everything he does if you want, BUT you would be up to your eye balls in logs files and they really grow huge fast if you dont pay attention to them .... if you just want him to be off the net or even the computer at a certain time thats easy to do, there are two ways you can do that on your mandrake, 1) one way is using the config security file, 2) using cron .... thats what i would do myself if i think that #1) would be the easiest and either Bruno, Striker or myself can help you with that its easy enough to do .... and you can set the times he can be online example say from 7pm --11pm ... mon tru Thurs .... 9am --2am on weekends .. its up to you when set up his times ....

Link to comment
Share on other sites

There's also Dansguardian, one of the best filters out there with possible white and blacklisting. B) That's omething other than just timing measures but I think maybe it's just what you may be looking for after all.

Link to comment
Share on other sites

Well I looked for the Kpp log file and what I found did not show me when anyone was logged in it just showed when it had been updated from what I can make out.You're right Steel its not really logging his time so much as limiting his time online that I am interested in. If you can walk me through how to set up a cron job or something that would be great. The thing is the time may not be consistent, but the amount of time he is allowed online is he gets 2 hours a day and that is supposed to be it. Of course if we have to set it up to a certain time a day we can arrange that.

Link to comment
Share on other sites

Hi RolanaThe idea Steel has is pretty good . . . but what he will need from you to make the code are:- The login name of your son- The 2 hours you allow him every day to use the computerB) Bruno

Link to comment
Share on other sites

I'd say if for example you want from 4 to 6 PM in weekdays and 3 to 8 PM on weekends . . . that it would be possible.:thumbsup: Bruno

Link to comment
Share on other sites

Been there done that eh? Teenagers can be so annoying! I guess i will pick the hours myself. I figure between 6-8 p.m. Monday- Friday and between 4-9 p.m. on Saturday and Sunday. Apparently they have clan battles some times, and he couldn't pick a time.

Link to comment
Share on other sites

Okay . . . . . here is the code for Mandriva: ( I tested it and it works )Before you start make backups of the most important files you are going to change:

# cp /etc/security/time.conf /etc/security/time.conf-BACKUP# cp /etc/pam.d/kde3 /etc/pam.d/kde3-BACKUP# cp /etc/pam.d/login /etc/pam.d/login-BACKUP

Then first open the /etc/security/time.conf file and add at the bottom:

login|kde3;*;greg;Wk1800-2000 | Wd1600-2100
Next open the /etc/pam.d/kde3 file and just below the "auth" entries add the line :
account required pam_time.so
Next open the /etc/pam.d/login file and again just below the "auth" entries add the line :
account required pam_time.so
Next, if you are not 100% confortable with the Vi editor: logged in as "su" give the command
# export EDITOR=mcedit

( if you like Vi you can skip that command. ) This way you can edit the contrab file in the MC editorNext give the command:

# crontab -e

and put this in the file:

10 21 * * 6-7 /usr/bin/skill -KILL -u greg10 20 * * 1-5 /usr/bin/skill -KILL -u greg
Finally give the command
# crontab -u greg -e

and put this in that file:

01 21 * * 6-7 /usr/bin/zenity --warning --title "Alert" --display=:0 --text "Time is up, you will automatically be logged out in 9 minutes"01 20 * * 1-5 /usr/bin/zenity --warning --title "Alert" --display=:0 --text "Time is up, you will automatically be logged out in 9 minutes"
What this all means:He can log in only from n 6-8 p.m. Monday- Friday and between 4-9 p.m. on Saturday and Sunday . . . . he will automatically be logged out at 20.10 during the week and 21.10 in the weekends ( gave him 10 minutes extra B) ) . . but he will get a popup at 20.01 and 21.01 telling him that "Time is up, you will automatically be logged out in 9 minutes" so he can finish up and save his "work". ;) NOTES: - you will have to password protect the BIOS to prevent live CD/DVD booting of Live CD/DVD- remove the "failsafe" option from the bootmenu- if he knows the root-password he will be able to get around the lock we make- if he knows your password he can login to your account- if you multiboot he will be able to just start up another distro- once the above code is implemented there is no way around the lock, so even yourself you will not be able give him an extra hour . . . sorry.B) Bruno
Link to comment
Share on other sites

Ok I ran into a problem all ready

cp /etc/security/time.conf /etc/security/time.conf-BACKUP[root@localhost rolana]# cp /etc/pam.d/kde3 etc/pam.d/kde3-BACKUPcp: cannot create regular file `etc/pam.d/kde3-BACKUP': No such file or directory[/copy]I didn't go any farther as I figure I probably should get this backed up first.I did however change the dialup password, my password and the root password so even if he boots into another distro he won't be able to connect.
Link to comment
Share on other sites

Ok I ran into a problem all ready
cp /etc/security/time.conf /etc/security/time.conf-BACKUP[root@localhost rolana]# cp /etc/pam.d/kde3 etc/pam.d/kde3-BACKUPcp: cannot create regular file `etc/pam.d/kde3-BACKUP': No such file or directory

hi Rolanayeah you see the problem???
# cp /etc/pam.d/kde3 etc/pam.d/kde3-BACKUP
you forgot the # cp /etc/pam.d/kde3 /etc/pam.d/kde3-BACKUP
Link to comment
Share on other sites

you forgot the # cp /etc/pam.d/kde3 /etc/pam.d/kde3-BACKUP
That was my mistake . . . I made an error in the instructions I posted . . . sorry about that.I did correct the original post.:thumbsup: Bruno
Link to comment
Share on other sites

Ok looks like everything went ok this time, but I'll have to wait until tomorrow and see how he makes out to know for sure.He liked the extra 10 minutes by the way :)Thanks so much to both of you, this is really helpful.

Link to comment
Share on other sites

Ok looks like everything went ok this time, but I'll have to wait until tomorrow and see how he makes out to know for sure.Thanks so much to both of you, this is really helpful.
I am glad that everything worked out Rolana, that should keep your son outta trouble and in check now as long as you dont give him your username and password :P :P ........ and all the credit goes to Bruno he did all the work
That was my mistake . . . I made an error in the instructions I posted . . . sorry about that.I did correct the original post.B) Bruno
No worries Bruno, if all my mistakes were small like that i would be a very happy camper
Link to comment
Share on other sites

You're very welcome Rolana !You can test the 2 most essetial commands like this:( as user )

$ /usr/bin/zenity --warning --title "Alert" --display=:0 --text "YES, this works as advertised"

This should trigger a popup.( as root )

# /usr/bin/skill -KILL -u greg

This should log out the user "greg"If those 2 commands do what they promisse you only have to test if he can log in before/after the hours he's permitted.:P BrunoPS: @Steel :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...