我需要一个解决方案,允许我控制每个用户在计算机上花费的时间,不包括空闲时间(某种家长控制)。我试过timekpr,但是它在Ubuntu13.10上不起作用。帕姆_时间不是我要找的.
下面是我的实际情况:
系统中有几个用户帐户,我们称它们为U1、U2和U3。我想知道它们每一个活动的时间和时间,但是如果U2不执行任何操作(只是空闲登录)或在不注销的情况下锁定他的帐户,则不应该将其计算在他在计算机上的总时间。如果用户超过了分配给他帐户的时间限制,我希望能够运行bash脚本(当他试图在指定的时间内使用计算机时也是如此)。
我的计算机作为服务器工作,所以不止一个用户可以同时使用它。用户在图形模式下工作(统一,X窗口系统),而不使用终端。
有没有什么第三方软件,系统命令,一些建议,我能用什么来开发我自己的解决方案,等等?
发布于 2014-01-13 14:28:27
`w U1` - login informations for example for user U1 you can see in output something like this
User tty login@ idle JCPU PCPU what此外,您还可以制作bash脚本并放入crontab (例如,每天运行几次),使用变量w U1、w U2、w U3,并将一些otput也放入文件中。
`/var/run/utmp` - List of current login sessions.
`/var/log/wtmp` - List of previous login sessions
`/var/log/btmp` - List all the bad login attempt发布于 2014-01-13 14:39:02
我对限制总花费时间没有任何答案。但是,对于根据一天中的时间限制,pam_time可能是您想要的。
从手册页:
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.发布于 2020-05-31 11:55:53
我的应用程序LittleBrother包含了您的一些需求。这仍然是一个正在进行的工作,所以我总是很高兴人们测试它,并给我反馈。
我的应用程序的一些特性:
pinging)可以用于确定这些设备上的活动。与Linux主机不同,应用程序将无法终止活动。然而,播放时间将被添加到整个播放时间中,因此将对允许的时间以及Linux主机上的休息时间规则产生影响。LittleBrother应用程序的此功能已被LittleBrotherTaskbar.所取代。https://unix.stackexchange.com/questions/109148
复制相似问题