Results 1 to 4 of 4

Thread: Auto login/logout with USB stick (pamusb)

  1. #1
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Auto login/logout with USB stick (pamusb)

    I've been following this post, I have installed libpam-usb and pamusb-tools, added the following line to the end of my /etc/pam.d/common-auth:
    Code:
    auth    sufficient    pam_usb.so
    Setup the device nickname and username, and even added the following to my /etc/pamusb.conf in the correct place:
    Code:
            <agent event="lock">xscreensaver-command --lock</agent>
            <agent event="unlock">xscreensaver-command --deactivate</agent>
    Here is what happens:
    I unplug my USB stick, and xscreensaver locks the screen. Okay, this is what I wanted it to do. But when I reinsert the stick, nothing happens. If I try logging in from a TTY with the stick inserted, it still requires me to enter a password. (I am trying to set this up as a passwordless setup, and basically use my stick as my password. (Please let me take my own risks... I am just testing the setup)).

    So here is what I would like to be preforming, but it is not, and I am stumped on how to fix it....

    I want the screensaver to lock when I unplug the drive, and I want the screensaver to unlock when I reinsert the drive. (This is my primary goal). I would also like to be able to use the drive as my password for authentication with GDM, sudo, TTY logins, etc.

    Is there something I have forgotten to do? The first part works fine (of locking the screen when the drive is removed), but I can't get the authentication process to work without a password, or even automatically log me in.

    Best Regards,
    Dr Small
    Last edited by Dr Small; December 8th, 2009 at 03:33 PM.
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  2. #2
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Auto login/logout with USB stick (pamusb)

    I finally went back and read that post, and found one spot that I missed.. I was putting the new shared object at the bottom of the file, instead of ABOVE the other one, as was stated.. :S

    So, here is my setup.
    /etc/pam.d/common-auth has two lines that look like this:
    Code:
    auth    sufficient      pam_usb.so
    auth    [success=1 default=ignore]      pam_unix.so nullok_secure
    I created a couple startup items, such as:
    Code:
    pamusb-agent
    xscreensaver -nosplash
    Now, when I pull the pendrive, it locks the screen, and when I reinsert it, I unlocks it. Logging out to GDM, and entering my username automatically logs me in, and yet this setup still allows me to use my system in case I lose the key, I can still log in with my password.
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  3. #3
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Auto login/logout with USB stick (pamusb)

    Very nice Doc

    Next time, at least give us a chance to answer =)
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  4. #4
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Auto login/logout with USB stick (pamusb)

    Quote Originally Posted by bodhi.zazen View Post
    Very nice Doc

    Next time, at least give us a chance to answer =)
    Haha! Sorry about that bodhi
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •