11

I have a fingerprint scanner on my HP Probook Laptop. I'm running Ubuntu 11.10 on it. How do I make use of it?

2 Answers 2

3

You can take a look at the Fingerprint integration page on Launchpad, where there are all the infos about fingerprint readers, to see if yours is supported and how to use it on Ubuntu.

2

First, check the compatibility of your hardware.

Supported devices | freedesktop.org

Unsupported devices | freedesktop.org

Second, please understand that logging in via fingerprint identification, AKIK, is sometimes unreliable.

fprint is not entirely stable, and may not work all the time.

From the Ubuntu Forums

The rest of this post was transcribed from This post on the Ubuntu Forums.
I have not used it personally, but it was the most up to date tutorial for Ubuntu I could find. You may need to debug the gksu.py wrapper script

To configure your device:

Install fprint

sudo apt-get install fprint-demo libfprint-dev libfprint0 libpam-fprint aes2501-wy

Next, enroll your fingers using either the terminal or a graphical user interface.

Terminal

pam_fprint_enroll

Graphical

fprint_demo

Next, configure PAM so that the fingerprint reader can be useful.

gksu gedit /etc/pam.d/common-auth

Add this at the top of the file (do it multiple times for however many attempts you want to allow)

# Fingerprint only
auth sufficient pam_fprint.so

Or, use these options if you want to require the fingerprint and the password.

# Fingerprint + password
auth required pam_fprint.so

For programs using gksudo/gksu, copy the wrapper gksu.py below to /usr/local/bin/gksu add fingerprint support and enter the following code

sudo mv ./gksu.py /usr/local/bin/gksu
sudo chmod 755 /usr/local/bin/gksu
sudo apt-get install python-gnome2-extras python-pexpect

gksu.py


#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
#       gksu wrapper, supporting fprint - v 0.2
#       
#       Copyright 2008 Thimo Kraemer <[email protected]>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.


import sys, time
import subprocess, pexpect
import gtk, gksu2


gksu_cmd = ['/usr/bin/gksu']
sudo_cmd = ['/usr/bin/sudo']


# Do not handle requests just asking for a password or using su
skip = False
arg_skip = ['-w', '--su-mode', '-p', '--print-pass']
for arg in sys.argv:
if arg in arg_skip:
    skip = True
    break
if skip or len(sys.argv) == 1:
proc = subprocess.Popen(gksu_cmd + sys.argv[1:])
proc.wait()
sys.exit(0)


# Simple message box asking for the fingerprint
class InfoBox(gtk.MessageDialog):
def __init__(self):
    gtk.MessageDialog.__init__(
        self,
        parent         = None,
        flags          = gtk.DIALOG_DESTROY_WITH_PARENT,
        type           = gtk.MESSAGE_INFO,
        buttons        = gtk.BUTTONS_NONE,
        message_format = ' Fingerprint requested ')
    self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN)
    self.set_position(gtk.WIN_POS_CENTER)
            self.set_image(gtk.image_new_from_stock(gtk.STOCK_DIALOG_AUTHENTICATION, gtk.ICON_SIZE_DIALOG))
    self.format_secondary_text('')

def fade(self, msg=None):
    self.hide_all()
    if msg:
        self.format_secondary_text(msg)
        self.show_all()
    time.sleep(0.1)
    while gtk.events_pending():
        gtk.main_iteration()

infobox = InfoBox()


# Prepare gksu context
gksu_context = gksu2.Context()
if '-d' in sys.argv or '--debug' in sys.argv:
print 'Prepare gksu context'
debug = True
else:
debug = False
gksu_context.set_debug(debug)

if '-D' in sys.argv or '--description' in sys.argv:
try: i = sys.argv.index('-D')
except ValueError: i = sys.argv.index('--description')
gksu_context.set_description(sys.argv[i+1])
else:
gksu_context.set_description(sys.argv[-1])

if '-m' in sys.argv or '--message' in sys.argv:
try: i = sys.argv.index('-m')
except ValueError: i = sys.argv.index('--message')
gksu_context.set_message(sys.argv[i+1])

if '-g' in sys.argv or '--disable-grab' in sys.argv:
gksu_context.set_grab(False)
else:
gksu_context.set_grab(True)

if '-P' in sys.argv or '--prompt' in sys.argv:
# No context method defined for this argument
pass

# Create sudo command
if debug:
print 'Create sudo command'
sudo_cmd.append('-S')
sudo_cmd.append('-p')
sudo_cmd.append('GNOME_SUDO_PASS')

if '-u' in sys.argv or '--user' in sys.argv:
try: i = sys.argv.index('-u')
except ValueError: i = sys.argv.index('--user')
sudo_cmd.append('-u')
sudo_cmd.append(sys.argv[i+1])

if not ('-k' in sys.argv or '--preserve-env' in sys.argv):
sudo_cmd.append('-H')
sudo_cmd.append('--')

sudo_cmd.append(sys.argv[-1])


# Interact with sudo
if debug:
print 'Run sudo:', ' '.join(sudo_cmd)
sudo = pexpect.spawn(sudo_cmd[0], sudo_cmd[1:])
while sudo.isalive():
response = sudo.expect([
    pexpect.EOF,
    pexpect.TIMEOUT,
    'Scan .*',
    'GNOME_SUDO_PASS',
    '.+',
    ])

# EOF, TIMEOUT
if response <= 1:
    continue

if debug:
    print '[sudo] ', sudo.after.strip()

# Hide infobox
infobox.fade()

# Ask for fingerprint
if response == 2:
    msg = sudo.after.strip()
    infobox.fade(msg)
# Ask for password
elif response == 3:
    try:
        pw = gksu2.ask_password_full(gksu_context, 'Password: ')
    except:
        pw = ''
    sudo.sendline(pw)


infobox.destroy()
2
  • sudo apt-get install fprint-demo libfprint-dev libfprint0 libpam-fprint aes2501-wy Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package fprint-demo E: Unable to locate package libfprint-dev E: Unable to locate package libfprint0 E: Unable to locate package libpam-fprint E: Unable to locate package aes2501-wy Oct 23, 2020 at 14:57
  • If you are "unable to locate fprint-demo" package, just add new repository using command add-apt-repository ppa:fingerprint/fprint Nov 9, 2022 at 9:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .