简体   繁体   中英

Programmatically unlock screen (desktop linux)

As it's in the title, I'd like to programmatically unlock my default lock screen. The programming language doesn't matter, it can be either a script language or a compiled language.

My current OS is linux mint with cinnamon desktop handler, but if the answer is general, that's even better.

Assuming my software always knows the plain text current password.

Disclaimer:

  • I know, it's NEVER safe to store the password in plaintext, even if it's compiled or something (actually, that's plaintext too...).

  • I know, if my "secret" signal is not safe enough (which is quite probably possible), then it could be outplayed by determined rogue people.

__

My reason to do this, is that I'd like to implement an RFID based login system for my PC :) (I know, RFID is fakeable, yees, yes...)

You can check the generic screensaver manpage (the xdg API). There is the option reset . This method should be supported by most screen savers. You may need to test them.

If the policies of screen saver requires password, you need to tweak pam policies/modules. Too long to describe here, and you should really read documentation to understand pam (and security implications: pam is generic, so you should understand and check that there are not side effect on other authentication mechanisms). But what you are doing, it seems very pam related (and possibly there is already a module for it, you describe something similar to what it is used on POS).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM