Change login process

Hello everybody !

At the beginning - I hope everything will be understandable as I know that my english skills are not as good as I would like.

I use Manjaro Linux for one year, previously used Ubuntu for 6 years. Today I got an idea to create small USB electronic device but I don't know how to manage it under Linux. What this device should do ? This will be small box with USB interface, inside will be electronics to detect RFID card. If user will approach his RFID card to device - Linux should login that user to system. I suppose that I should write small linux kernel driver to USB that will be run in background and each correct try will log user. Of course, when user has no card it is still possible to login by login and password. My biggest problem is: how to change behaviour of standard Linux login window? What should I google or where find information? I'm not afraid with changing kernel, writing new modules, I would like to learn Linux at all :slight_smile:

Thanks in advance for ideas !
Greetings
Mateusz

You will have to learn a lot about the USB hid driver. It is possible to have the USB itself download the authentication program and run it. You will also have have some hardware that reads the RFID card, and you need the ability to create the card in the first place. BTW this kind of setup probably will not pass a security audit, because all the bad guy needs to break in is the card.

go here: USB Human Interface Device (HID) Configuration

Thank you very much ! Yes, I know that it is not the best security but it is not solution for company but just me - for my own home laptop and for learning more linux kernel and writing drivers. I know how to create electronics device for RFID, I don't know at all how to manage it under Linux, but with resources from you and google I hope that I can do it and learn a lot.

Thanks ! :slight_smile:

Thanks ! I know that this is not the most secure solution but this device will not be applied in company but only in my home laptop. The main goal is to improve my skills and learn more Linux kernel and programming. I think that is good way to learn. With the resources you sent and google I hope to learn a lot. Thanks once again !

I am not really sure what you mean by that: Linux has no "login window".

Linux (like UNIXes, to which it is quite similar) has a "login" process. Whenever a terminal becomes free, this login process will start a session there and present a (text-based) login/password prompt.

What you perhaps mean by "login window" is the following: many graphical environments (GNOME, KDE, ....) don't deem it reasonable that the user uses the described login process and then start whatever graphical environment he wants. They basically intercept the login process and replace it with their own graphical version of it. Search for "gdm" (graphical display manager) for a detailed descrition of how this works.

This doesn't mean you have to use it, though. you can still trigger the native login process and use it to log in a user at the system. You will probably make use of "udev"-rules: "udev" is a kernel driver that constantly scans the system for changes in hardware. If you, for instance, put in a CD into the CD-ROM-drive and you get a nice symbol on your desktop, this is (ultimately) udev at work. udev works from a rule-set which basically states "if this and this happens execute this list of actions".

I hope this helps.

bakunin

Yes, I meant gdm but I didn't know the name of that. The clue is to see that gdb and after use card skip login process. It can be used to 2-step user verification (eg. card + simple pin later) but this in the future.

So as I understand, the way is to create usb device driver that will send information to my laptop that the card has been near to RFID reader and after that some rule in udev will process my login process ?

Thanks ! :slight_smile:

Yes, this should - by and large - be the way.

I hope this helps.

bakunin