0 کاربر و 1 مهمان درحال مشاهده موضوع.
http://linuxconfig.org/linux-authentication-login-with-usb-device
## /etc/pam.d/common-auth - authentication settings common to all services## This file is included from other service-specific PAM config files,# and should contain a list of the authentication modules that define# the central authentication scheme for use on the system# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the# traditional Unix authentication mechanisms.## As of pam 1.0.1-6, this file is managed by pam-auth-update by default.# To take advantage of this, it is recommended that you configure any# local modules either before or after the default block, and use# pam-auth-update to manage selection of other modules. See# pam-auth-update(8) for details.# here are the per-package modules (the "Primary" block)auth [success=3 default=ignore] pam_fprintd.so max_tries=1 timeout=10 # debugauth sufficient pam_usb.so auth [success=1 default=ignore] pam_unix.so nullok_secure try_first_pass# here's the fallback if no module succeedsauth requisite pam_deny.so# prime the stack with a positive return value if there isn't one already;# this avoids us returning an error just because nothing sets a success code# since the modules above will each just jump aroundauth required pam_permit.so# and here are more per-package modules (the "Additional" block)auth optional pam_cap.so # end of pam-auth-update config
<?xml version="1.0" ?><!--pamusb.conf: Configuration file for pam_usb.See http://www.pamusb.org/doc/configuring--><configuration> <!-- Default options --> <defaults> <!-- Example: <option name="debug">true</option> --> </defaults> <!-- Device settings --> <devices> <!-- Example: Note: You should use pamusb-conf to add devices automatically. <device id="MyDevice"> <vendor>SanDisk Corp.</vendor> <model>Cruzer Titanium</model> <serial>SNDKXXXXXXXXXXXXXXXX</serial> <volume_uuid>6F6B-42FC</volume_uuid> <option name="probe_timeout">10</option> </device> --> <device id="USB-Unlock"> <vendor>UFD 2.0</vendor> <model>Silicon-Power16G</model> <serial>13061744017E60036CD98C63033</serial> <volume_uuid>C47D-B31E</volume_uuid></device></devices> <!-- User settings --> <users> <!-- Note: Use pamusb-conf to add a user, then you can tweak manually the configuration here if needed. --> <!-- Example: Authenticate user scox using "MyDevice", and configure pamusb-agent to automatically start/stop gnome-screensaver on key insertion and removal: <user id="scox"> <device>MyDevice</device> <option name="quiet">true</option> <agent event="lock">gnome-screensaver-command -lock</agent> <agent event="unlock">gnome-screensaver-command -deactivate</agent> </user> Configure user root to authenticate using MyDevice, but update one time pads at every login (default is 1 hour): <user id="root"> <device>MyDevice</device> <option name="pad_expiration">0</option> </user> --> <user id="userName"> <device>USB-Unlock</device> <agent event="lock">gnome-screensaver-command -l</agent> <agent event="unlock">gnome-screensaver-command -d</agent></user></users> <!-- Services settings (e.g. gdm, su, sudo...) --> <services> <!-- Example: Speed up hotplugging by disabling one time pads --> <!-- <service id="pamusb-agent"> <option name="one_time_pad">false</option> </service> --> <!-- Disable output for 'su' (needed for gksu) --> <!-- <service id="su"> <option name="quiet">true</option> </service> --> </services></configuration>
$ pamusb-agentpamusb-agent[5507]: pamusb-agent up and running.pamusb-agent[5507]: Watching device "USB-Unlock" for user "userName"pamusb-agent[5507]: Device "USB-Unlock" has been removed, locking down user "userName"...pamusb-agent[5507]: Running "gnome-screensaver-command -l"pamusb-agent[5507]: Locked.pamusb-agent[5507]: Device "USB-Unlock" has been inserted. Performing verification...pamusb-agent[5507]: Executing "/usr/bin/pamusb-check --quiet --config=/etc/pamusb.conf --service=pamusb-agent userName"pamusb-agent[5507]: Authentication succeeded. Unlocking user "userName"...pamusb-agent[5507]: Running "gnome-screensaver-command -d"pamusb-agent[5507]: Unlocked.pamusb-agent[5507]: Device "USB-Unlock" has been removed, locking down user "userName"...pamusb-agent[5507]: Running "gnome-screensaver-command -l"pamusb-agent[5507]: Locked.pamusb-agent[5507]: Device "USB-Unlock" has been inserted. Performing verification...pamusb-agent[5507]: Executing "/usr/bin/pamusb-check --quiet --config=/etc/pamusb.conf --service=pamusb-agent userName"pamusb-agent[5507]: Authentication succeeded. Unlocking user "userName"...pamusb-agent[5507]: Running "gnome-screensaver-command -d"pamusb-agent[5507]: Unlocked.^Cpamusb-agent[5507]: Caught keyboard interruption, exiting...
https://wiki.ubuntu.com/LightDM[SeatDefaults]greeter-hide-users=true
https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/1307163