[mythtv-users] Off Topic: Auto mount samba shares

Joacim J jocke4news at gmail.com
Thu Feb 22 22:01:44 UTC 2007


Rod,
Thanks for the VERY detailed answer. I will consider the options.
I also have NFS for some shares but not for the ones  that are  valid in
this case but  (also accessed from Windows). I will start tests with NFS
mounting at boot time and see how it works.
The server is up 24/7 (almost :) )

Thanks again!
// Joacim

On 2/22/07, Rod Smith <mythtv at rodsbooks.com> wrote:
>
> On Thursday 22 February 2007 15:30, Joacim J wrote:
> > Hello,
> >
> > I am a bit off topic here but hopes for some ideas...
> >
> > I have a server and a client both running Fedora Core 6. The server have
> a
> > number of samba shares and different users have different access (e.g.
> no
> > access, read, read/write). Those shares I would like to have mounted
> > automatically at login time (not via fstab) and this because the client
> are
> > used by others in the family.
> >
> > User A
> > Read access to //server/movies to be mounted as /home/UserA/movies
> >
> > User B
> > Read/Write access to //server/movies to be mounted as /home/UserB/movies
> > Read/Write access to //server/apps to be mounted as /home/UserB/apps
> >
> > How can I solve this?
>
> There are several ways to do this. One is to create /etc/fstab entries,
> such
> as:
>
> //server/movies  /home/UserB/movies   smbfs
>
> users,noauto,credentials=/etc/samba/credentials/UserB,uid=500,gid=100,fmask=0640
> 0 0
>
> (That's a single very long /etc/fstab line that's gotten split across
> three
> lines.) You might want to tweak this in various ways, such as changing the
> uid and gid numbers, changing the fmask value, using cifs instead of smbfs
> (each has its advantages and disadvantages), or removing "noauto" from the
> line (to have the share be mounted automatically at boot time). You'd need
> to
> create a file called /etc/samba/credentials/UserB, which would hold the
> user's Samba username and password:
>
> username=UserB
> password=foobar
>
> This file should, of course, have restrictive permissions to keep anybody
> but
> the user in question (and root) from reading it. Once this is configured,
> the
> user can mount the share just by typing "mount ~/movies"
> or "mount /home/UserB/movies" -- or if you omit the "noauto" option, the
> share will mount automatically at boot time.
>
> Another way to do this is to have the user type "smbmount //server/movies
> ~/movies" to mount the share. The user will ordinarily have to type a
> password, although there are ways around this, some more awkward than
> others.
> One that works well in a script would be to pass the -o credentials=file
> option to smbmount, which points to a credentials file, as described
> earlier.
>
> You could use either of these commands in a user's login script to mount
> the
> share automatically when the user logs in, and to a logout script to
> unmount
> the share when the user logs out. (A simple script could easily get
> confused
> by multiple login sessions, though.) Is there any particular reason you
> want
> to have the shares mounted and unmounted when the users log in and out
> rather
> than have them mounted when the system boots? The latter is likely to be
> simpler to configure, although it could cause problems if the server goes
> down frequently.
>
> Yet a third option would be to use NFS instead of Samba, but if you're not
> already running NFS on the server, that's unlikely to offer much in the
> way
> of advantages. One NFS advantage is that it tends to recover a bit better
> if
> the server goes down and then comes back up again, in my experience.
>
> --
> Rod Smith
> http://www.rodsbooks.com
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>



-- 
Regards
Joacim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070222/76a53046/attachment.htm 


More information about the mythtv-users mailing list