mount_smbfs gives error when stored crypted pw is used

Matthias Apitz guru at
Tue Jun 6 11:03:32 UTC 2017


At work I have to run FreeBSD (12-CURRENT, amd64) in vbox on Win7 host
and used successful mount_smbfs to mount the hosts disk to FreeBSD. This
worked fine until the last password change of the domain pw we have todo
every 12 weeks or so.

Now the new crypted and stored pw from /etc/nsmb.conf is not accepted
anymore. In detail, when I do:

# cat pw-file.txt


and take the above pw with cut&paste in the mouse and run the command,
I'm prompted for the pw (because I removed it from the file
/etc/nsmb.conf); the mount is fine:

# mount_smbfs -I -U apitzXXXXXX -u guru -g wheel //apitzXXXXXX-ltoh/Users/apitzXXXXXX /win

now I crypt the pw which I still have in the mouse due to cut&paste and
store the hash in the file:

# smbutil crypt

# tail -5 /etc/nsmb.conf 


(and you may believe me, I did it around 10 times to check it);

now the mount failes:

# mount_smbfs -I -U apitzXXXXXX -u guru -g wheel //apitzXXXXXX-ltoh/Users/apitzXXXXXX /win
mount_smbfs: unable to open connection: syserr = Authentication error

all this is fine reproduceable: the pw works when typed, it does not
work from the file /etc/nsmb.conf; it works as well from the file, when
I store it there in clear text, i.e. not encrypted with smbutil. That
means somehow the hash seems to be wrong.

I checked both cases ith truss(1):

truss in error case:

openat(AT_FDCWD,"/dev/nsmb",O_RDWR,00)           = 3 (0x3)
ioctl(3,SMBIOC_LOOKUP,0xffffd9d8)                ERR#80 'Authentication error'
write(2,"mount_smbfs: ",13)                      = 13 (0xd)
write(2,"unable to open connection",25)          = 25 (0x19)
stat("/usr/share/nls/C/",0x7fffffffd378) ERR#2 'No such file or directory'
stat("/usr/share/nls/libc/C",0x7fffffffd378)     ERR#2 'No such file or directory'
stat("/usr/local/share/nls/C/",0x7fffffffd378) ERR#2 'No such file or directory'
stat("/usr/local/share/nls/libc/C",0x7fffffffd378) ERR#2 'No such file or directory'
write(2,": syserr = Authentication error"...,32) = 32 (0x20)

truss in success case (i.e. with typed password)

openat(AT_FDCWD,"/dev/nsmb",O_RDWR,00)           = 3 (0x3)
ioctl(3,SMBIOC_LOOKUP,0xffffd9d8)                = 0 (0x0)
nmount(0x801251140,0x14,0x0)                     = 0 (0x0)

Any ideas about this?


Matthias Apitz, ✉ guru at, ⌂  ☎ +49-176-38902045
Public GnuPG key:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the freebsd-questions mailing list