Autor |
Nachricht |
|
Titel: software to control access to computer?
Verfasst am: 06.12.2008, 04:35 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
Is there some application can install that will
a) prevent a user from logging in after a certain time of day
and
b) if that user is already logged in when that time comes around, will log him out
Thanks. |
|
|
|
|
|
|
Titel: software to control access to computer?
Verfasst am: 06.12.2008, 08:50 Uhr
|
|
Anmeldung: 29. Jul 2007
Beiträge: 288
|
|
as far as i know there was a similar problem a while ago. He managed that problem with a script in the users dir.
But it could use up too many resources of the computer.
maybe theres a tool for that but i dont really think so. If i find something useful i'll post it here.
[edit]: couldn't find a tool. But neither the script. sry
But at least i found out, that he used crontab to check whether the user is logged in after a "certain time of day" and if so, he gets logged out.
that's what youre searching for,aren't you ? |
_________________ Ich bin nur dafür verantwortlich was ich SAGE,
Nicht das was du verstehst.
|
|
|
|
|
|
Titel:
Verfasst am: 06.12.2008, 20:49 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
Thanks for looking.
I found a lot about pam_time and am trying to digest it.
timekpr sounds perfecct, but it seems to be mostly about Ubuntu. It comes in a deb package. Do you think it would install and run on Kanotix?
https://launchpad.net/timekpr |
|
|
|
|
|
|
Titel:
Verfasst am: 07.12.2008, 09:37 Uhr
|
|
Anmeldung: 29. Jul 2007
Beiträge: 288
|
|
hmm i dont really know. i'll try it later.
You should just try,too |
_________________ Ich bin nur dafür verantwortlich was ich SAGE,
Nicht das was du verstehst.
|
|
|
|
|
|
Titel:
Verfasst am: 24.12.2008, 04:02 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
Well, I am learning about pam_time. It seems that there needs to be a directory inside /etc/pam.d, named for each service to which a pam rule applies. There are many possible rules. So for example, there is a /etc/pam.d/login file. Inside that file there are lines which can refer the login service to one of the pam modules, such as pam_time.so. If pam.d/login tells login to do so, login will look in /etc/security/time.conf for instructions about how to handle login requests at certain hours of the day. The days and hours can be specified in /etc/security/time.conf.
So I think I need to know the name of the service that is linux's access to the internet, if I want to limit internet access hours. I created a file called /etc/pam.d/http, and inside it I put one line:
account requisite pam_time.so
Then in /etc/security/time.conf I put the line:
http;*;test;Al!2000-0800
I thought this would allow my user named "test" to access the internet only during the hours of 0800 to 2000. The ! means "all but"
But it didn't work.
Is "http" the correct name for the service? |
|
|
|
|
|
|
Titel:
Verfasst am: 24.12.2008, 04:17 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
Another angle I am exploring: perhaps my linux-pam or pam_time module is not loaded:
Code:
test@ryankanotix:~$ lsmod
Module Size Used by
af_packet 24968 2
i915 25856 2
drm 83988 3 i915
freq_table 5792 0
nfs 246508 0
lockd 67592 1 nfs
sunrpc 173052 3 nfs,lockd
ppdev 10244 0
lp 12836 0
video 17544 0
sbs 19592 0
dock 10656 0
container 5504 0
button 8848 0
battery 11012 0
ac 6148 0
capifs 6792 1
rsrc_nonstatic 14080 0
pcmcia_core 41236 1 rsrc_nonstatic
parport_serial 8320 0
parport_pc 37284 1 parport_serial
parport 37576 3 ppdev,lp,parport_pc
nls_utf8 3072 1
ntfs 108864 1
fuse 47252 0
speedstep_lib 6404 0
snd_cmipci 36512 0
gameport 16776 1 snd_cmipci
snd_pcm_oss 44928 0
snd_mixer_oss 17792 1 snd_pcm_oss
snd_pcm 81028 2 snd_cmipci,snd_pcm_oss
snd_page_alloc 10888 1 snd_pcm
snd_opl3_lib 11392 1 snd_cmipci
snd_hwdep 10244 1 snd_opl3_lib
snd_mpu401_uart 9728 1 snd_cmipci
snd_seq_dummy 4740 0
snd_seq_oss 33280 0
snd_seq_midi 9600 0
snd_seq_midi_event 8448 2 snd_seq_oss,snd_seq_midi
snd_seq 53488 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer 24452 3 snd_pcm,snd_opl3_lib,snd_seq
snd_rawmidi 25728 2 snd_mpu401_uart,snd_seq_midi
snd_seq_device 9228 6 snd_opl3_lib,snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi
snd 54020 12 snd_cmipci,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_opl3_lib,snd_hwdep,snd_mpu401_uart,snd_seq_oss,snd_seq,snd_timer,snd_rawmidi,snd_seq_device
soundcore 8800 1 snd
psmouse 40208 0
pcspkr 4224 0
floppy 60772 0
i2c_i801 10128 0
serio_raw 8068 0
i2c_core 26368 1 i2c_i801
iTCO_wdt 11940 0
iTCO_vendor_support 4868 1 iTCO_wdt
intel_agp 25620 1
agpgart 35144 3 drm,intel_agp
sg 36764 0
sr_mod 17828 1
joydev 11328 0
evdev 11136 4
dm_snapshot 19108 0
raid10 26496 0
raid456 127760 0
xor 17032 1 raid456
raid1 25984 0
raid0 9728 0
multipath 10112 0
linear 7552 0
md_mod 82452 6 raid10,raid456,raid1,raid0,multipath,linear
dm_mirror 24320 0
dm_mod 58688 2 dm_snapshot,dm_mirror
usbhid 29664 0
hid 29312 1 usbhid
ehci_hcd 36236 0
e1000 127424 0
uhci_hcd 26768 0
usbcore 138504 4 usbhid,ehci_hcd,uhci_hcd
sd_mod 30720 4
thermal 14472 0
processor 32072 1 thermal
fan 5764 0
capability 5896 0
commoncap 8320 1 capability
test@ryankanotix:~$
If it is not currenlty loaded, as seems to be the case, how do I start up a module?
Thanks. |
|
|
|
|
|
|
Titel:
Verfasst am: 24.12.2008, 09:42 Uhr
|
|
Anmeldung: 11. Jul 2006
Beiträge: 164
Wohnort: westerwald
|
|
try it with bash:
logout after 100 mins and 19.59h
Code:
#!/bin/bash
while : ; do
((count++))
if [ $count -gt 100 -or `date +%H` -gt 19 ];then
dcop ksmserver ksmserver logout 0 0 0
fi
sleep 60
done
|
|
|
|
|
|
|
Titel:
Verfasst am: 24.12.2008, 09:48 Uhr
|
|
Anmeldung: 17. Dez 2003
Beiträge: 16790
|
|
Alternative using cron - define limit and create sound files with shutdown warning. Well shutdown may be a bit brutal, but you can use it as example. Also you can extend it with timelimits.
Code:
#!/bin/sh
# Usage: save as /usr/local/bin/counter.sh
# chmod 700 /usr/local/bin/counter.sh
# crontab -e
# * * * * * /usr/local/bin/counter.sh
LIMIT_MIN=120
DIR=/var/log/counter
FILE=counter-$(date +%F).log
mkdir -p "$DIR"
chmod 700 "$DIR"
date +%H:%M >> "$DIR/$FILE"
MIN=$(($LIMIT_MIN + 1 - $(wc -l "$DIR/$FILE"|cut -f1 -d' ')))
[ -f /usr/local/share/counter/${MIN}m.ogg ] && aoss play /usr/local/share/counter/${MIN}m.ogg 2>/dev/null
if [ $(wc -l "$DIR/$FILE"|cut -f1 -d' ') -gt $LIMIT_MIN ]; then
echo Timelimit reached. Shutting down!
/sbin/poweroff
fi
|
|
|
|
|
|
|
Titel:
Verfasst am: 24.12.2008, 14:36 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
Thanks. Those are some interesting ideas with bash (which I haven't done much in.) They may do what I have in mind.
Would those scripts apply to all users, or can I specify which ones?
Once logout or shutdown was forced on a user, because the time of day passing beyond the specified limit, what would happen if he/she tried to login again, a few minutes later?
Is there a service of a particular name that Kanotix uses for internet access?
How do I load a module that is not currently running?
thanks. |
|
|
|
|
|
|
Titel:
Verfasst am: 25.12.2008, 07:23 Uhr
|
|
Anmeldung: 11. Jul 2006
Beiträge: 164
Wohnort: westerwald
|
|
that are only examples for learning
a script in users .kde-autostart runs only for the loggined user
modprobe modul (as root) |
|
|
|
|
|
|
Titel:
Verfasst am: 29.12.2008, 04:48 Uhr
|
|
Anmeldung: 20. Mar 2008
Beiträge: 29
|
|
I still can't tell if pam_time is running on my system. And is it even something that "runs?" I can't make heads or tails out of the documentation on man pages or via google search.
None of these commands are recognized.
modprobe pam
modprobe pam_time
modprobe pam_time.so
modprobe time
modprobe time.so
modprobe linux-PAM
Is pam_time a module that needs to be loaded? If so, how does one load it?
Thanks. |
|
|
|
|
|
|