Login to a linux system using your USB Drive

5.30 in the morning I accomplished this, just before Java exams could not sleep with excitement and to my dismay the net did not work properly.  I forced myself to go to sleep otherwise I would have certainly messed my papers ( thank God, I did not).  Now lets move on to the topic.

Certainly, I had thought of this idea long ago, before diving into linux( openSUSE 11.2) and deciding to learn about it as much as I can.  Ankur Bhaiya had given me a hint that it will have to do something with PAM modules. To be honest, I am a lazy humbug who has a lot of great ideas and always fails to accomplish them. So even completing this gives me a great sense of achievement.

I followed the instructions from this site which has a PAM module for pen drives

I hope everyone can follow the instructions pretty well as they are pretty easy to understand and follow. However I myself would like to add a point or two on this issue which I experienced and maybe you can experience yourself too.

If you are downloading and compiling from the source, which I did, on openSUSE 11.2 I really had no need to get a dependency module for python-celementtree. However python-gobject is now python-gobject2 which you may also get it as a one click install from openSUSE software search. I cannot say about the others.

The example which is given here is for the root user and so our module will perfectly run when we login as a root. However if we run it as some other user we may not be able to execute all the commands. The reason is the pamusb module uses pmount which is a wrapper on the mount command and is used in many debian based systems. So we might need to get the package pmount which is also available as a one click install in openSUSE.  However, this is not enough we have to login as root and then move to the directory /usr/bin/ and after this we change the permissions of pmount as chmod 111 pmount ( this gives executable permission to every user in the computer).

The last step is to finish it with writing a logout command. The pamusb.conf already indicates that it has something to do with gnome or kde or whatever we are using.  I am a great fan gnome( just because it is simple, no fights over here) So I will continue with gnome itself.

Change the following
<agent event=”lock”>gnome-screensaver-command –lock</agent>
<agent event=”unlock”>gnome-screensaver-command –deactivate</agent>
<agent event=”lock”>gnome-session-save –logout</agent>
<agent event=”unlock”>gnome-screensaver-command –deactivate</agent>


One thought on “Login to a linux system using your USB Drive

  1. I’ve used pamusb on my Fedora laptop with good results. I’ve been trying to install it on my SLED 11.2 desktop, and having no luck. It’s always complaining about the versions of libxml2 I have installed. When I try to make pamusb, I get a whole lot of undefined reference errors from libxml2-2.7.3. There doesn’t seem to be any way to build this on SuSE Enterprise LInux.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s