LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-03-2012, 01:08 PM   #1
Nabeel
Member
 
Registered: Nov 2009
Location: Pakistan
Distribution: Ubuntu
Posts: 294

Rep: Reputation: 17
Question Paternal control softwares


I am using ubuntu 10.10 and I was looking for something using which I could specify login time for my siblings.
 
Old 01-04-2012, 10:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Ubuntu comes with PAM so if you add "account required pam_time.so" to /etc/pam.d/login and then edit /etc/security/time.conf to your liking ('man pam_time; man time.conf;') you should be able to deny users at specified times. If you want to enforce logouts too you should run a logout daemon, application or script to present a warning and (gracefully) kill user processes.
 
1 members found this post helpful.
Old 01-04-2012, 11:21 AM   #3
Nabeel
Member
 
Registered: Nov 2009
Location: Pakistan
Distribution: Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 17
First Thanks for looking into my prob. .I did went to '/etc/security/time.conf' but I could not find any thing that grants a set no of hours e.g. 2 hours, one per day, at any time of the day. All examples there, were of a specified Interval. Thanks
 
Old 01-04-2012, 11:51 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You could use squid as a proxy server
http://www.linuxhomenetworking.com/w...ess_with_Squid
Or look here:
https://www.linuxquestions.org/quest...-linux-521665/

Kind regards

Last edited by repo; 01-04-2012 at 11:54 AM.
 
Old 01-04-2012, 12:47 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Nabeel View Post
I could not find any thing that grants a set no of hours e.g. 2 hours, one per day, at any time of the day.
OK but "specify login time" is not the same as "limit session duration". Anyway. On user login (UID >= 500) you could create a task that runs in the background warning the user say ten minutes before closing the session allowing the user to save data and exit cleanly and finally kills the session. For this to work you want to run the 'at' service (rarely mentioned best way to run unattended jobs in the background), pam_script (to start the job on login), Xdialog or equivalent (to display a warning to the user) and a shell script (to Rule Them All).
 
Old 01-29-2012, 01:55 AM   #6
Nabeel
Member
 
Registered: Nov 2009
Location: Pakistan
Distribution: Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 17
@unSpawn: I have tried many tutorials but I am unable to achieve this. Possibally because of my lack of experiance. Could you please provide me with a sort of site which explains this process in detail and also describe how to create a script to do this sort of task. and add it to startup.


Regards
 
Old 01-29-2012, 01:56 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Nabeel View Post
I have tried many tutorials but I am unable to achieve this.
Please don't say that. Show it. Trying stuff means you've got URI's of sites you visited, software you installed, steps you took and errors you got. You posted nothing of that.


Quote:
Originally Posted by Nabeel View Post
Possibally because of my lack of experiance.
When you know a wee bit of how your distribution works, read the documentation that comes with the software (and actually follow instructions ;-p) and practice you will never have to say that again.


Quote:
Originally Posted by Nabeel View Post
Could you please provide me with a sort of site which explains this process in detail
Uh. I guess that's LQ ;-p Get the pam_script tarball from http://freecode.com/projects/pam_script, install the gcc compiler and PAM development library if you need to, then compile and install pam_script. Check the README inside libpam-script_0.1.12.tar.gz. Create /etc/security/onsessionopen with contents:
Code:
#!/bin/sh --
echo 'export DISPLAY=":0.0"; /usr/bin/gnome-session-quit --logout >/dev/null 2>&1; sleep 5m; /usr/bin/gnome-session-quit --no-prompt >/dev/null 2>&1' | /usr/bin/at now + 1 hour
exit 0
and make certain the file is owned by user and group root, mode 0755. Locate /etc/pam.d/gdm and add a line in the "session" section:
Code:
session required /lib/security/pam_script.so
For testing change the "now + 1 hour" to read "now + 1 minute" or you'll be waiting too long. Test by logging in as an unprivileged user and run 'atq' in a terminal window. it should show one job. This job can be killed by the user ('at -d %jobspec'). If you don't like that add "runas=root" to the "session required" line then test again. Running 'atq' as root user should now show ('atq; at -c %jobspec') the logout job.

The following things are asserted:
- you use GNOME as Desktop Environment and GDM as greeter. For KDE-3 use something like 'dcop --all-sessions --user ${LOGNAME} ksmserver default logout 0 0 0', for KDE-4 you have to fiddle with 'dbus' or see if you have 'kdehalt'. For XFCE there is 'xfce${VERSION}-session-logout',
- the 'at' service is running and unprivileged users may execute at jobs (see 'man at.allow'),
- none of your $subjects or $serfs should have Sudo, wheel, su, 'ssh root' or equivalent rights,
- you realize killing sessions is a punitive measure and only addresses one symptom: treating the cause would be preferable.
 
1 members found this post helpful.
  


Reply



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
how to install softwares from other os like windows and also run portable softwares rudramurthy Linux - Newbie 6 10-16-2008 06:33 AM
Contract and Bightness control OR iris control for Logitech Communicate STX webcam nicsmr Linux - Hardware 0 03-13-2008 10:35 AM
tc traffic control tc traffic control Linux QoS control tool(noob help) inv|s|ble Linux - General 1 07-26-2007 11:12 AM
Control amount of time a user may be logged in. (Parental Control) darrensnospam Mandriva 13 02-18-2006 05:01 PM
Can't launch redhat-network-control after updating gnome-control-center fedetxf Red Hat 0 12-12-2003 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:51 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