From nobody Fri Aug 30 22:39:00 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WwY3f6tz5z5McSX for ; Fri, 30 Aug 2024 22:39:10 +0000 (UTC) (envelope-from doug@safeport.com) Received: from fledge.watson.org (fledge.watson.org [147.160.157.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "A1-48603", Issuer "A1-48603" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WwY3f2BRFz4tBn for ; Fri, 30 Aug 2024 22:39:10 +0000 (UTC) (envelope-from doug@safeport.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 147.160.157.40 is neither permitted nor denied by domain of doug@safeport.com) smtp.mailfrom=doug@safeport.com Received: from fledge.watson.org (doug@localhost [127.0.0.1]) by fledge.watson.org (8.17.1/8.17.1) with ESMTPS id 47UMd0Wd013910 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 30 Aug 2024 22:39:00 GMT (envelope-from doug@safeport.com) Received: from localhost (doug@localhost) by fledge.watson.org (8.17.1/8.17.1/Submit) with ESMTP id 47UMd049013905; Fri, 30 Aug 2024 22:39:00 GMT (envelope-from doug@safeport.com) X-Authentication-Warning: fledge.watson.org: doug owned process doing -bs Date: Fri, 30 Aug 2024 22:39:00 +0000 (UTC) From: doug@safeport.com Reply-To: doug@fledge.watson.org To: Polytropon cc: Nikos Vassiliadis , FreeBSD questions Subject: Re: mount SMB In-Reply-To: <20240829220603.c2c6fba0.freebsd@edvax.de> Message-ID: <7238dfd-4bd0-87c1-1359-7724a579513@safeport.com> References: <20240829220603.c2c6fba0.freebsd@edvax.de> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; HAS_XAW(0.00)[]; ARC_NA(0.00)[]; FROM_NO_DN(0.00)[]; ASN(0.00)[asn:6405, ipnet:147.160.157.0/24, country:US]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; HAS_REPLYTO(0.00)[doug@fledge.watson.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmx.com,freebsd.org]; R_DKIM_NA(0.00)[]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[safeport.com]; TO_DN_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3] X-Rspamd-Queue-Id: 4WwY3f2BRFz4tBn On Thu, 29 Aug 2024, Polytropon wrote: > On Thu, 29 Aug 2024 12:34:59 +0200, Nikos Vassiliadis wrote: >> I am looking for a way to mount SMB filesystems. I am using >> smbnetfs successfully but I am not comfortable with the idea >> of having the password of the share in a file. > > Would it be acceptable to have it in a file beneath /etc only > being rw/--/-- and belonging to root:wheel? In that case, why > not use FreeBSD's native mount_smbfs setup? > > In /etc/nsmb.conf: > > [default] > workgroup=YOUR_WORKGROUP_NAME > > [SERVERNAME] > addr=123.456.789.10 > > [SERVERNAME:USERNAME] > password=TOPSECRET > > where SERVERNAME and USERNAME correspond to the server's name > and the username you use to access the share (with the proper > password). If no password is provided, mount will ask for it. > > See "man nsmb.conf" for details. > > Integrate it in /etc/fstab: > > //USERNAME@SERVERNAME/SHARENAME /smb/share smbfs rw,noauto 0 0 > > Add "drive letters" ("//blah.../c$") if absolutely needed. > Leave out "noauto" if you want the system to mount the share > at startup. If not, mount it like any normal filesystem > interactively: > > # mount /smb/share > > Please note that this is "old man's advice" and may not apply > anymore, because now you need a smartphone app and a paid > subscription in order to mount SMB shares... ;-) > > There is also a FreeBSD Handbook chapter about SMB / CIFS and > its integration. There's also a FAQ section. > > > >> Keep in mind that I am after a terminal-only solution and not >> after a X11 file browser. > > The provided solution might work. Good luck! First, know that I am also an old guy. You do not say if you are running this on a server, tablet or phone. Assuming it is not a phone I use this on a number of systems running an X11 window manager. Works fine and is IMO the best way to do this. Doug