From owner-freebsd-questions@freebsd.org Tue Jun 6 11:03:32 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A13DBFD5F6 for ; Tue, 6 Jun 2017 11:03:32 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8E13958 for ; Tue, 6 Jun 2017 11:03:31 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [2.247.252.203] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1dIBI4-0000Vt-9b for freebsd-questions@freebsd.org; Tue, 06 Jun 2017 12:00:44 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id v56A0eqI004410 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 6 Jun 2017 12:00:40 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id v56A0dCZ004409 for freebsd-questions@freebsd.org; Tue, 6 Jun 2017 12:00:39 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Tue, 6 Jun 2017 12:00:34 +0200 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: mount_smbfs gives error when stored crypted pw is used Message-ID: <20170606100034.GA4245@c720-r314251> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) User-Agent: Mutt/1.8.0 (2017-02-23) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 2.247.252.203 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 11:03:32 -0000 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, 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 SXXXXXXXXXXXXXXXXXXXXXX!=20 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 10.49.8.27 -U apitzXXXXXX -u guru -g wheel //apitzXXXXXX-l= toh/Users/apitzXXXXXX /win Password: # 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 Password: $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1713 # tail -5 /etc/nsmb.conf=20 [APITZXXXXXX-LTOH:APITZXXXXXX] workgroup=3DOCLC password=3D$$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1713 (and you may believe me, I did it around 10 times to check it); now the mount failes: # mount_smbfs -I 10.49.8.27 -U apitzXXXXXX -u guru -g wheel //apitzXXXXXX-l= toh/Users/apitzXXXXXX /win mount_smbfs: unable to open connection: syserr =3D 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) =3D 3 (0x3) ioctl(3,SMBIOC_LOOKUP,0xffffd9d8) ERR#80 'Authentication err= or' write(2,"mount_smbfs: ",13) =3D 13 (0xd) write(2,"unable to open connection",25) =3D 25 (0x19) stat("/usr/share/nls/C/libc.cat",0x7fffffffd378) ERR#2 'No such file or dir= ectory' stat("/usr/share/nls/libc/C",0x7fffffffd378) ERR#2 'No such file or dir= ectory' stat("/usr/local/share/nls/C/libc.cat",0x7fffffffd378) ERR#2 'No such file = or directory' stat("/usr/local/share/nls/libc/C",0x7fffffffd378) ERR#2 'No such file or d= irectory' write(2,": syserr =3D Authentication error"...,32) =3D 32 (0x20) truss in success case (i.e. with typed password) openat(AT_FDCWD,"/dev/nsmb",O_RDWR,00) =3D 3 (0x3) ioctl(3,SMBIOC_LOOKUP,0xffffd9d8) =3D 0 (0x0) nmount(0x801251140,0x14,0x0) =3D 0 (0x0) Any ideas about this? matthias --=20 Matthias Apitz, =E2=9C=89 guru@unixarea.de, =E2=8C=82 http://www.unixarea.d= e/ =E2=98=8E +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub --UugvWAfsgieZRqgk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAlk2fTkACgkQR8z35Hb+ nRFVAg//WytisFZ93a/PoyFr/UADc4RidCkXqO2AwBQij5V1JdN2p96Rqk0NA/n7 FjndDYbu+SMYsRafxr0puOwZcfYXvI7V1ZESR64dp9orbIraOkdP584/tMWotwMw 9Xdq9yVmS7uq1ASjCLr2JSMe2dxZR+kxWvOQ1Bp8o1hAlxy2Q6ERfnJOp2cV7cuq DtJ6Lv9P71bpnv19jDmiBecOmBXyHhlQWaf+f9MHNn0b+7dOVCum1NBR4VOeTDcc R+cX5NWkjSzd2uRlqlXyW1M1u12E6E4zUKSA9oXXmhLl667wtQbvRa5UpU9srNLY ane6X0LdF4w4WLB1aq+0cb5fk51bopJ1OvU9Oi32quA/iQVeylw7Bw3pac89wemE IuOL/oBDttN6xfcOPFCoKyXLwuwxgXaDJqs0PKxpdhl4yRF9XaGvcu+P6eigL8Sf qAy9aW2qscyVLkPkdGURcpUMIM065mbtnw1+Sf+PGkrNLQGNKihmwuCowgXdlwTG dCFSH1zzfAMTg2DSSJZ3ZwcCDHuPvVQH7EgNH3DJDsS8fas5uxgP4BnWC6HVsXEU JYc0D8HFDccbIv51vOfxIRwSPwQWi5hfTj/MWvDFs3dIRBTIA3c8h8phUTqmlVAD ew8N0aBAEIbbhJd/cWLLibd/jnyNpP2GkPlROUyqeZfCqryWRcY= =m6yc -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--