Linux 中的击键动态
我正在考虑为 Linux 实现一个击键动态(根据人们的打字模式对人们进行身份验证)应用程序。 在我看来,我有两种选择:
- 扩展 Linux 登录以支持击键动态
- 创建一个桌面锁定程序,该程序“锁定”屏幕并且只能由具有特定打字模式的打字员解锁
替代方案 1 可能吗? Windows 支持通过 msgina.dll 扩展登录过程,Linux 是否支持此类功能?
对于替代方案 2,是否可以禁用鼠标和键盘?
I'm thinking of implementing a keystroke dynamics (authenticating people based on their typing patterns) application for Linux. As I see it, I have two alternatives:
- Extend the Linux logon to support keystroke dynamics
- Create a desktop-locker program which "locks" the screen and can only be unlocked by a typist with a particular typing pattern
Is alternative 1 possible? Windows supports extending the logon process via msgina.dll, does Linux support something of the sort?
For altenative 2, is is possible to disable the mouse and keyboard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
libpam 具有插件功能。 所以是的,完全有可能,就像(臭名昭著的)msgina :)
锁定屏幕是相当敏感的 - 谁负责? 窗口管理器、X 服务器、会话管理器、屏幕保护进程,?
恐怕不同的桌面环境(Gnome、KDE...)可能会有不同的看法。 尽管现在,我非常肯定它们都将共享某种 FreeDesktop dbus 接口来协调此类功能。
libpam has plugin ability. so yes, totally possible, like the (in)famous msgina :)
locking the screen is mmm rather touchy - who is responsible? window manager, X server, session manager, the screen saver process, ?
I'm afraid different desktop environments (Gnome, KDE...) might have different opinions. Although these days, I'm pretty positive all of them will share some kind of FreeDesktop dbus interface to coordinate this type of functionality.
假设这不仅仅是一个玩具(换句话说,如果您打算分发),请务必考虑在出现问题时如何绕过打字模式分析。 随着时间的推移,我的打字模式可能会发生很大的变化,因为我的手腕问题时不时就会出现。 当他们这样做时,我的打字可能会发生显着变化。 即使我的打字从早上到晚上有所变化,我也不会感到太惊讶,因为我或多或少感到疲倦和/或喝了咖啡。
Assuming this is more than just a toy (in other words, if you plan to distribute), be sure you think about how to get around the typing pattern analysis when things go wrong. My typing patterns probably change quite a bit over time, as I've got wrist problems that flare up now and then. When they do, my typing probably changes markedly. I wouldn't be too surprised if my typing changes somewhat from morning to night even, as I am more or less tired and/or caffeinated.
嘿,Linux 是开源的,你可以做任何你想做的事:-)
你很可能不需要修改内核。 例如,终端登录是由
login
程序控制的。 更改源代码并重建它肯定会让您做您需要做的事情,尽管我不知道这有多困难:-)图形登录由窗口管理器负责,因此要更改哪个程序取决于哪个窗口您使用的管理器。
编辑:再想一想,我不确定
login
是否足够早执行以捕获击键动态。 此外,这有点冒险,因为如果您的版本登录失败,可能会导致登录和修复问题变得困难。 您可能需要查看getty
并了解它如何调用login
。 如果您在图形界面中执行此操作可能会更容易,因为您始终可以退回到文本终端来解决任何问题。Hey, Linux is open source, you could do anything you want :-)
It is very likely that you don't need to modify the kernel. For example, terminal login is controlled by the
login
program. Changing the source and rebuilding it will definitely allow you to do what you need to, although how difficult it is I've no idea :-)Graphical login is taken care of by the window manager, so which program to change depends on which window manager you use.
EDIT: On a second thought, I'm not sure if
login
is executed early enough to catch the keystroke dynamics. Besides, it is a bit risky because if your version of login fails, it could make it difficult to login and fix the problem. You might need to take a look atgetty
and see how it invokeslogin
. If you do it in a graphical interface it might be easier since you can always fall back to text terminal to fix any problem.执行此操作的正确方法可能是通过 PAM 身份验证模块。 请在此处查看模块编写者指南: http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_MWG.html
基本上,您可以将模块添加到 PAM 堆栈,让它执行按键操作分析,然后将成功或失败传递给系统。 这使您可以将其与控制台登录过程集成,甚至可以与 SSH(如果在那里启用了 PAM)集成。 我不太确定它如何与 KDM 或 GDM 等图形登录一起使用。 我知道您可以将 PAM 模块与这些模块一起使用,但当然交互是通过 GUI 文本框完成的。
The proper way to do this would probably be through a PAM authentication module. Check out the module writers guide here: http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_MWG.html
Basically you can just add your module to the PAM stack, have it do its keystroke analysis, and then pass either success or fail to the system. This lets you integrate it with the console login process, and even SSH if PAM is enabled there. I'm not quite sure how it would work with a graphical login such as KDM or GDM. I know you can use PAM modules with those, but of course the interaction is done through the GUI textbox.