Per user fstab
Anthony M Simonelli
a.simonelli at sbcglobal.net
Wed Apr 18 03:04:49 UTC 2007
On Tue, 2007-04-17 at 14:14 +0100, WipeOut wrote:
> Magnus Runesson wrote:
> > On Mon, 2007-04-16 at 19:18 +0100, WipeOut wrote:
> >> Hi,
> >>
> >> Is it possible to have a per user fstab file so that samba shares are
> >> mounted at user login?
> >>
> >> I know that I can create network connections from the "places" menu but
> >> these don't work in all applications (Thunderbird and GFTP as examples)
> >> so I need to go back to the old way of mounting the network shares into
> >> the local file system but would like to manage it on a per user basis
> >> rather than globally..
> >>
> >> Any suggestions?
> >>
> >
> > Take a look at pam_mount.
> >
> > You can find some info about how I had used it at
> > http://theworldofapenguin.blogspot.com/2006/12/securing-your-laptop.html
> > Most information are about encryption, but the part about pam_mount
> > should be the same.
> >
> > Regards,
> > /Magnus
> >
> >
> Thanks.. I will look into that..
What I do at work is use AutoFS. With AutoFS, you define "maps" for
each user within /etc/auto.master file. For Example:
/home/bob/Network/ /home/bob/.auto.smb --timeout=60
/home/jack/Network/ /home/jack/.auto.smb --timeout=60
Then you define the map file. In this case, they're called .auto.smb in
the user's home directory. This is where you list the shares you want
to mount along with mounting options. For Example, the .auto.smb file
would contain:
SHARE1 -fstype=cifs,file_mode=0644,dir_mode=0755,uid=user,gid=users,credentials=/home/bob/.credentials ://SERVER/SHARE1
This will mount SMB share //SERVER/SHARE1 as SHARE1 in /home/bob/Network
directory. You also need to specify a .credentials file
What's great about AutoFS is that it doesn't mount these shares unless
you try to access the mount. It's worked out great at our company
though we have a small amount of users. You should also specify
daemonoptions='--ghost' within /etc/init.d/autofs. This saves a "ghost"
version of the share so that you can access it even when it's not
mounted.
Check the Ubuntu Forums for more information www.ubuntuforums.org
More information about the ubuntu-users
mailing list