[Samba] problems mounting smbfs

Jay Ts jay at metran.cx
Fri Jul 19 13:19:02 GMT 2002

> > Just in case it might help got this from
> > http://www.uwsg.iu.edu/hypermail/linux/net/0102.0/0042.html
> > Edit /etc/fstab to add the following line: 
> > 
> > 
> > //[servername]/[mountpoint] /mnt/[mountdirectory] smbfs 
> > noauto,rw,username=[username] 0 0 
> It is never a good idea to store your password in this file, as it is 
> world-readable by default. When you want to mount the share type: 
> # mount /mnt/[mountdirectory] 
> and you'll be prompted for [username]'s password. 

Yes, that is the most secure method.  (Unless you've got a
shoulder surfer, or someone picking up the EMF signal from
your monitor. ;-)

But it can also be inconvenient.  A slightly less secure,
but still sort-of-ok (usually ;) method is to use a credentials
file, like this:

//maya/d  /maya-d  smbfs  credentials=/usr/local/samba/private/maya-cred,uid=jay,gid=jay,fmask=600,dmask=700 0 0

Of course, make sure that file in a directory readable/writable only
by root, and set the permissions of the file likewise.

This method allows the share to be mounted at boot time. 

Jay Ts
jay at jayts.cx

More information about the samba mailing list