libpam-mount automounts SMB shares at login, just like Windows

Posted on Mon, 8th October 2007 at 20:00 under Eureka!, Coding, Linux

Now my Ubuntu workstation, part-way upgraded to the 7.10 “Gutsy Gibbon” release, works almost as elegantly as my Windows machines have worked forever. My network music store now auto-mounts into my home directory when I login. Finally. I’ve been beating away at this, on and off, for bloody years. I’m just not a great sysadmin, I guess!

Method follows.

  1. sudo apt-get install libpam-mount
  2. read the docs under /usr/share/doc/libpam-mount/
  3. sudoedit /etc/pam.d/gdm to append @include common-pammount
  4. sudoedit /etc/security/pam_mount.conf to enable the luserconf setting and append ro to the options_allow setting
  5. create file .pam_mount.conf in home directory containing:

    volume username smbfs servername Music ~/Music nosuid,nodev,ro - -

  6. sudo /etc/init.d/gdm restart

2 Responses

  1. Hmph… but not reliable. Didn’t auto-mount on my first login this evening, but did the next time. The error message left in /var/log/auth.log was the enigmatic “pam_mount(pam_mount.c:480) mount of Music failed”. So on goes debugging mode. sudoedit /etc/security/pam_mount.conf and change the debug setting to 1.

    Reply
    1. Automatic mount worked first time this evening so the debug log doesn’t show anything useful yet.

      Reply

Leave a Reply

You may also log in to post a comment.

XHTML:

If you want to <q>tag</q>, please balance these; a, i, em, b, strong, u, blockquote, q, ul, li, ol, abbr, code, pre, sub and sup.