How do I use the fingerprint scanner on a HP Probook?

6,183

Solution 1

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.

Solution 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()
Share:
6,183

Related videos on Youtube

Damiano Fusco
Author by

Damiano Fusco

Updated on September 18, 2022

Comments

  • Damiano Fusco
    Damiano Fusco almost 2 years

    I researched this on SO and could not find a truly complete answer. Many people, including myself, are able to send an email through C# System.Net.Mail by using port 25 or 587 and NOT using SSL. For example, see here: https://stackoverflow.com/questions/1317809/sending-email-using-a-godaddy-account

    Others have a solution using System.Web.Mail which is obsolete though: How can I send emails through SSL SMTP with the .NET Framework?

    However, it seems nobody has a solution yet on how to send the emails using SSL with port 465. Does anybody have a solution or at least knows why SSL is not working from C#?

    Here is the code I'm using:

    try
    {
        MailMessage mail = new MailMessage("[email protected]", receivingEmail, subject, body);
        string host = "smtpout.secureserver.net";
        int port = 465; // it's 465 if using SSL, otherwise 25 or 587
        SmtpClient smtpServer = new SmtpClient(host, port);
        smtpServer.Credentials = new NetworkCredential("[email protected]", "yourpassword");
        smtpServer.EnableSsl = true;
        smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtpServer.Send(mail);
    }
    catch (Exception ex)
    {
        // do something with the exception
        ...
    }
    
    • dash
      dash about 12 years
      Are you getting a specific exception? If you are, please post the exception message. Otherwise, it's worth raising a support ticket with GoDaddy.
    • jrummell
      jrummell about 12 years
      Have tried modifying the System.Web.Mail answer to use System.Net.Mail?
    • dash
      dash about 12 years
    • Damiano Fusco
      Damiano Fusco about 12 years
      dash, I get a "Failure to send email" exception and the inner exception is "Unable to Send email" with another inner exception saying "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
    • Damiano Fusco
      Damiano Fusco about 12 years
      jrummell, no I did not try that as that answer did not actually work for me.
  • Kashif Nazar
    Kashif Nazar over 3 years
    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