Salve ragazzi,
avete mai visto i vostri colleghi autenticarsi (loggarsi con ID e PASSWORD) in un computer senza usare la password, ma un dispositivo USB? No?
Ma in che mondo vivete?
Scherzo... Però, io ho sempre sognato di inserire una password "hardware" (si lo so, sono nerd fin nelle ossa).
Per chi non sapesse minimamente di cosa sto parlando, in poche parole l'autenticazione si svolgerà semplicemente inserendo la periferica usb personale e lasciando vuoto il campo password. Tutto questo grazie a PAM!
avete mai visto i vostri colleghi autenticarsi (loggarsi con ID e PASSWORD) in un computer senza usare la password, ma un dispositivo USB? No?
Ma in che mondo vivete?
Scherzo... Però, io ho sempre sognato di inserire una password "hardware" (si lo so, sono nerd fin nelle ossa).
Per chi non sapesse minimamente di cosa sto parlando, in poche parole l'autenticazione si svolgerà semplicemente inserendo la periferica usb personale e lasciando vuoto il campo password. Tutto questo grazie a PAM!
Cos'è PAM?
PAM o Pluggable authentication modules costituisce a set of libraries and files that allow you to authenticate the user by other means different from the standard. This can not change the entire program in case of change in the method of authentication, and allows you to authenticate in a variety of ways, from fingerprints to the USB! In fact, the PAM module that manages access and authentication via USB. More information can be found on Wikipedia
Install pamusb
If you are on a Debian GNU / Linux you can easily install packages for the module pamusb with this command:
apt-get install libpam-usb-tools pamusb
At this point you need only enter our USB key and configure PAM for everything you need to function properly. So we're going to add our USB device among those available and we are going to associate our name with our user device choice. Typed at the terminal with superuser permissions:
pamusb-conf - add-device AuthChiave
This command will display the data in the device and you must confirm the choice with a classic "y" l ' operation you are going to do. Obviously you can replace with any name AuthChiave want as it will be the device ID. Now your device is recognized by pamusb but was not associated with any user, then proceed with the following command always super user:
pamusb-conf - add-user VOSTRONOMEUTENTE
If you want to check that everything is going your way, just run a check with this command:
pamusb-check VOSTRONOMEUTENTE
Now we just have to add the module as a possibility of authentication then edit the file in / etc / pam.d / common-auth and add the following line like this: Find the line (or similar):
auth required pam_unix.so nullok_secure
and add after this other line:
auth sufficient pam_usb.so
We're finished! Now just enter in the login or authentication (or if at - vostronomeutente ) your usb stick without having to enter the password, if required or just press Enter. If you do not want to press to send the password prompt, you can put the latter line only first-line authentication. You can, in addition, run a command when you remove the selected device, or upon insertion. To do this simply edit the file / etc / pamusb.conf , researching the following tags and modified in this way:
This will lock the screen when the device is removed, but will be reactivated when you enter them again. To activate this feature, we add-agent pamusb between the processes that start up automatically at the beginning of our session. To do this with Xfce 4.6 just go nel Menu > Impostazioni > Sessione e Avvio, e selezionare la tabella “Application autostart” e aggiungere pamusb-agent nella lista dei processi. A questo punto vi basterà riavviare la sessione per verificare i cambiamenti!
\u0026lt;user id="VOSTRONOMEUTENTE">
\u0026lt;device> AuthChiave \u0026lt;/ device> ;
\u0026lt;agent event="lock"> xscreensaver-command - lock \u0026lt;/ agent>
\u0026lt;agent event="unlock"> xscreensaver-command - deactivate \u0026lt; ; / agent>
\u0026lt;/ user>
This will lock the screen when the device is removed, but will be reactivated when you enter them again. To activate this feature, we add-agent pamusb between the processes that start up automatically at the beginning of our session. To do this with Xfce 4.6 just go nel Menu > Impostazioni > Sessione e Avvio, e selezionare la tabella “Application autostart” e aggiungere pamusb-agent nella lista dei processi. A questo punto vi basterà riavviare la sessione per verificare i cambiamenti!
Ops... ho fatto un casino!!
In caso di problemi relativi all’autenticazione,in situazioni veramente critiche, potrete sempre avviare un liveCD di qualsiasi distribuzione ed eseguire un chroot nella vostra root, eliminare direttamente i pacchetti installati e/o commentare the following line:
# auth sufficient pam_usb.so
All come back as before! And the good fairy will make life easier with some nice touches of rhyme and magic wand!
masand