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