Is it possible to have a USB drive function as a login token?
IE: I turn on my computer, plug the USB drive into my system and the system recognises it and logs me in? Likewise, logs me out should the drive be removed?
Thanks in advance :)
There is an article at LinuxConfig for Linux authentication login with USB device.
accomplished by use of Pluggable Authentication Modules ( PAM ) and some sort of USB storage device such as USB memory stick of Mobile phone with SD card attached.
This authentication technique can be also further expanded into Two-Factor authentication where two authentication methods involving USB token and one-time password can be merged together to produce a greater security.
A summary of actions,
sudo apt-get install pamusb-tools libpam-usb
sudo pamusb-conf --add-device my-usb-stick
sudo pamusb-conf --add-user ubuntu-user
auth sufficient pam_usb.so
auth required pam_unix.so nullok_secure
su ubuntu-user-- "ubuntu-user" is the username from step 3.
It's not a regular USB key, but have you looked at YubiKey? It can generate either one-time passwords or just send a normal but long password, and it's recognised as a USB keyboard so it works on pretty much any computer.