Michael Woodhams
2004-Oct-13 03:10 UTC
[Samba] 'credentials' file doesn't work - also observed by others
Background: Linux, Debian (Sarge). I want to auto-mount an smbfs at boot. smbmount version is 3.0.7-Debian. With the following in my fstab, I can do the mount as root, but have to provide a password (hence either I can't boot unattended, or can't mount it during boot): //<server>/<share> /mnt/point smbfs user,noauto,username=<user>/<domain>,uid=<user>,gid=<user> 0 0 I can make it automount by providing the password: //<server>/<share> /mnt/point smbfs user,noauto,username=<user>/<domain>,uid=<user>,gid=<user>,password=<password> 0 0 but this is insecure. I tried using credentials: //<server>/<share> /mnt/point smbfs user,noauto,username=<user>/<domain>,uid=<user>,gid=<user>,credentials=/etc/smbpassword 0 0 where /etc/smbpassword contains username=<user>/<domain> password=<password> but I get an error: 1741: session setup failed: ERRDOS - ERRnoaccess (Access denied.) SMB connection failed (I think '1741' is a PID - it changes each time.) To forstall some suggestions: * There are no non-alphanumeric charaters in <user>, <domain>, <password> etc. * There is a newline at the end of /etc/smbpassword * I've tried from the command line using 'smbmount', with the same results - works with "password=" but not with "credentials=" * I've tried giving the credentials file liberal permissions (666) * The password in the credentials file is correct - I've cut-and-pasted it to command line and had it work * I've tried (from command line) without the extra options like 'user' and 'noauto'. * Yes, I've googled - I found several others with the same problem, but no solution. http://lists.samba.org/archive/samba/2003-November/002040.html http://archives.mandrakelinux.com/cooker/2004-01/msg00114.php Michael W.
Tony Breeds
2004-Oct-13 10:45 UTC
[Samba] 'credentials' file doesn't work - also observed by others
On Wed, Oct 13, 2004 at 04:10:23PM +1300, Michael Woodhams wrote:> Background: Linux, Debian (Sarge). I want to auto-mount an smbfs at > boot. smbmount version is 3.0.7-Debian.<snip>> username=<user>/<domain> > password=<password>Isn't the syntax --- user = fred password = ***** domain = bloggs --- Thats what I have in mine and it's working with win2k and samba servers. Yours Tony linux.conf.au http://linux.conf.au/ Apr 18-23 2005 The Australian Linux Technical Conference!
Igor Belyi
2004-Oct-17 23:38 UTC
[Samba] Re: 'credentials' file doesn't work - also observed by others
Could you try something like that: in /etc/fstab: //<server>/<share> /mnt/point smbfs workgroup=<domain>,credentials=/etc/smbpassword 0 0 in /etc/smbpassword: username=<user> password=<password> Note that you should not add domain to the <user> in credentials file but put it as a separate option for smbmount. Hope it helps, Igor Michael Woodhams wrote:> Background: Linux, Debian (Sarge). I want to auto-mount an smbfs at > boot. smbmount version is 3.0.7-Debian. > > With the following in my fstab, I can do the mount as root, but have to > provide a password (hence either I can't boot unattended, or can't mount > it during boot): > > //<server>/<share> /mnt/point smbfs > user,noauto,username=<user>/<domain>,uid=<user>,gid=<user> 0 0 > > I can make it automount by providing the password: > > //<server>/<share> /mnt/point smbfs > user,noauto,username=<user>/<domain>,uid=<user>,gid=<user>,password=<password> 0 0 > > but this is insecure. I tried using credentials: > > //<server>/<share> /mnt/point smbfs > user,noauto,username=<user>/<domain>,uid=<user>,gid=<user>,credentials=/etc/smbpassword 0 0 > > where /etc/smbpassword contains > > username=<user>/<domain> > password=<password> > > but I get an error: > 1741: session setup failed: ERRDOS - ERRnoaccess (Access denied.) > SMB connection failed > > (I think '1741' is a PID - it changes each time.) > > To forstall some suggestions: > > * There are no non-alphanumeric charaters in <user>, <domain>, > <password> etc. > * There is a newline at the end of /etc/smbpassword > * I've tried from the command line using 'smbmount', with the same > results - works with "password=" but not with "credentials=" > * I've tried giving the credentials file liberal permissions (666) > * The password in the credentials file is correct - I've cut-and-pasted > it to command line and had it work > * I've tried (from command line) without the extra options like 'user' > and 'noauto'. > * Yes, I've googled - I found several others with the same problem, but > no solution. > http://lists.samba.org/archive/samba/2003-November/002040.html > http://archives.mandrakelinux.com/cooker/2004-01/msg00114.php > > Michael W. > >