how to mount cifs via /etc/fstab - is this a bug in Fedora 7 ?

Michal Jaegermann michal at harddata.com
Wed May 16 20:01:28 UTC 2007


On Wed, May 16, 2007 at 10:09:57AM -0700, Akemi Yagi wrote:
> On Wed, 16 May 2007 13:52:46 +0200, Valent Turkovic wrote:
> 
> > In my /etc/fstab I have:
> > 
> > //10.10.10.1/disk     /disk cifs username=xxx,password=xxx,uid=fedora74,gid=fedora74,bg,soft    0 0

There is no 'bg' option for cifs, at least documentation does not
mention it, and 'soft' is default.  It is also a good idea to
use 'credentials' file instead of sticking "username=xxx,password=xxx"
into /etc/fstab where read access cannot be limited while 'credentials'
need to be readable only by root.  See 'man mount.cifs'.

> I suggest using automounter to mount the Windows share.

Agreed.  Then you may have different credential files for different
servers and in a corresponding automounter script a code fragment
which looks somewhat like that:

if [ -e "$credfile" ]; then
        mountopts="$mountopts,credentials=$credfile"
        smbclientopts="-A $credfile -gL"
else
        smbclientopts="-N -gL"
fi
smbclient $smbclientopts ....
.....

with $credfile using the first argument to this script as a part
of its name.

   Michal




More information about the test mailing list