From owner-freebsd-questions@freebsd.org Fri Jan 20 04:35:50 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 BDF18CB998C for ; Fri, 20 Jan 2017 04:35:50 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.he.net", Issuer "GeoTrust SSL CA - G4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B04DA158C for ; Fri, 20 Jan 2017 04:35:50 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from ::ffff:99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA (AES128-SHA:SSLv3:Kx=RSA:Au=RSA:Enc=AES(128):Mac=SHA1) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Thu, 19 Jan 2017 20:35:42 -0800 To: freebsd-questions@freebsd.org From: David Christensen Subject: FreeBSD 11.0 and mounting SMB shared folder at boot without password Message-ID: <3a018208-2ad4-1b1d-302d-e5ab4f1f2fad@holgerdanske.com> Date: Thu, 19 Jan 2017 20:35:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 20 Jan 2017 04:35:50 -0000 freebsd-questions: I have a computer: toor@freebsd:/root # freebsd-version 11.0-RELEASE-p7 toor@freebsd:/root # uname -a FreeBSD freebsd 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 03:40:55 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 I am attempting to mount a Microsoft Windows shared folder (//dc8ct591/data) into my home directory (freebsd:/usr/home/dpchrist/.data) at boot, without having to enter my password. Using Xfce and Thunar, I can browse the network, see the shared folder, enter my credentials, and access files within the share. After RTFM and STFW, this is my current attempt: toor@freebsd:/root # ll /etc/fstab -rw-r--r-- 1 root wheel uarch 230 Jan 19 19:41 /etc/fstab toor@freebsd:/root # grep dc8ct591 /etc/fstab //dpchrist@dc8ct591/data /usr/home/dpchrist/.data smbfs rw,-N 0 0 toor@freebsd:/root # ll /etc/nsmb.conf -rw------- 1 root wheel uarch 85 Jan 19 19:42 /etc/nsmb.conf toor@freebsd:/root # cat /etc/nsmb.conf [default] workgroup=WORKGROUP [dc8ct591:dpchrist] password= If I run 'mount' with the -d option, I can see the system call to 'mount_smbfs': toor@freebsd:/root # mount -d /usr/home/dpchrist/.data exec: mount_smbfs -o rw -N //dpchrist@dc8ct591/data /usr/home/dpchrist/.data If I then run 'mount_smbfs' without the -N option and enter the password for dpchrist@dc8ct591, it works: toor@freebsd:/root # mount_smbfs -o rw //dpchrist@dc8ct591/data /usr/home/dpchrist/.data Password: toor@freebsd:/root # mount | grep -i dc8ct591 //DPCHRIST@DC8CT591/DATA on /usr/home/dpchrist/.data (smbfs) But if run 'mount', or 'mount_smbfs' manually with the -N option, it fails: toor@freebsd:/root # umount /usr/home/dpchrist/.data toor@freebsd:/root # mount | grep -i dc8ct591 toor@freebsd:/root # mount /usr/home/dpchrist/.data mount_smbfs: unable to open connection: syserr = Authentication error toor@freebsd:/root # mount_smbfs -o rw -N //dpchrist@dc8ct591/data /usr/home/dpchrist/.data mount_smbfs: unable to open connection: syserr = Authentication error I get the same result for shared folders on Samba 2:3.6.6-6+deb7u11 on Debian 7 (Wheezy) and on Windows XP SP2. I don't know how to get more information about the "Authentication error" encountered by mount_smbfs (no --verbose or --debug option, and doesn't seem to write into any file in /var/log). Any suggestions? David