How to do it...

By using any type of USB storage device and PAM, we can create the authentication token:

  1. To start with, we first need to install the packages required for PAM USB authentication. To do so, we run this command:
 $ sudo apt-get install pamusb-tools libpam-usb

  1. Once the packages are installed, we have to configure the USB device to use PAM authentication. To do so, we can either use a command, or else we can edit the /etc/pamusb.conf file.

To use the command method, first connect the USB device, and after that execute this command:

    $ sudopamusb-conf --add-device usb-device  

In the preceding command, usb-device is the name ...

Get Practical Linux Security Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.