What I do in my private time is none of your business.
Besides, your ability to make clear, easy-to-understand tutorial videos about TrueNAS makes me suspicious about your humanity.
If you must insist, then please prove you’re not a robot:
CLICK HERE, ONLY IF YOU SOLVED THE CAPTCHA
You cheated! But I can't stop you...
Unlike Linux (and Mac?), Windows does not let you change the user to connect to an SMB share. Whether you use a mapped network drive or the location bar in File Explorer, it will cache the credentials for that specific “server”.
So if you connect to the share \\192.168.0.100\documents
with the user bob
, then from now on it will automatically reuse bob
for any share that is located on 192.168.0.100
.
If you try to connect with another user (perhaps with different privileges or permissions on the share or underlying filesystem on the server), you’re out of luck! You have to clear the cached credentials and possibly even restart explorer.exe
.
Even if you try to connect to a different share on the same “server”, you’re stuck with the privileges and permissions of the user bob
. So let’s say you try to connect to \\192.168.0.100\archives
, you cannot specify a different user (sally
) to connect with. Not even temporarily, such as if you want to access the share with more or less permissions.
With Linux, you can connect as whomever you want, as much as you want, even on the same server. (Same IP address or hostname.) You can specify sally
or bob
as needed. Whether manually, or via the file explorer location bar, or in the fstab, or with systemd-mount, etc.
So what to do with Windows to “trick” it into thinking you’re connecting to “different servers”? Create custom hostnames under C:\Windows\system32\drivers\etc\hosts
Now it will let you use a different credential for each “server”, even though they all direct to the same server at 192.168.0.100
.
This has been working fine with no issues, up until TrueNAS Core 13.3, and hence, the newer version of Samba.
Apparently (and I could be interpreting this incorrectly), it causes a long delay, because you’re trying to authenticate with a user that supposedly doesn’t exist on the server.
“The connection is telling me this is bob
@ truenas.home
? I am 192.168.0.100
or truenas.local
. I am not truenas.home
.”
Adding the custom hostnames in the TrueNAS GUI (which reflect the same hostnames in Windows’ hosts
file) resolved this. No more warnings in the server’s log.smbd
logfile. No more delay. Instant connection.
Windows sucks.
But from this thread, and thanks to @ddaenen1, if you have a router that supports it, you can specify multiple custom hostnames to the same TrueNAS IP address.
Not a signature.
Not an endorsement.