SOLVED How to mount CIFS share as domain user?

falsesmb

Cadet
Joined
Nov 8, 2021
Messages
3
Hello all :cool:

I added TrueNAS to my Win Server 2019 Active Directory.
I setup home shares here: https://www.truenas.com/docs/core/sharing/smb/homeshare/

The home share dataset is using:
User: root
Group: SPG\domain admins
ACL Preset: Home
Path: /mnt/tank/software

From TrueNAS the test domain account is available:

id jsmith@spg.local uid=100001107(SPG\jsmith) gid=100000514(SPG\domain users) groups=100000514(SPG\domain users),100001107(SPG\jsmith),100001105(SPG\spgteam),90000002(BUILTIN\users)

From a Ubuntu client I am running:
sudo mount -vvv -t cifs //spg-truenas/homes -o username=jsmith,domain=spg.local,password=password,vers=3.11 /mnt/jsmith/

Error:
mount.cifs kernel mount options: ip=x.x.x.x,unc=\\spg-truenas\homes,vers=3.11,user=jsmith,domain=spg.local,pass=******** mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

After running the `sudo mount` command there is a newly created /home/SPG/jsmith directory:
# ls -l /home/SPG drwxr-xr-x 2 SPG\jsmith SPG\domain users 9 Nov 18 21:13 jsmith

From TrueNAS I can log into the test domain account:
# su - jsmith@spg.local SPG\jsmith@spg-truenas:~ $ pwd /home/SPG/jsmith

From dmesg:
[81834.599011] CIFS: Attempting to mount //spg-truenas/homes [81834.662683] CIFS VFS: cifs_mount failed w/return code = -2

TrueNAS /var/log/samba4/log.smbd
make_connection_snum: SMB_VFS_CONNECT for service 'jsmith' at '/mnt/tank/software/SPG/jsmith' failed: No such file or directory [2021/11/18 21:51:00.188732, 0] ../../source3/smbd/service.c:169(chdir_current_service)

  1. So TrueNAS is making a new /home/SPG/jsmith directory when the user attempts to login.
  2. But the TrueNAS samba log is expecting a jsmith directory in /mnt/tank/software.
  3. Is this a bug in TrueNAS?
 
Last edited:

falsesmb

Cadet
Joined
Nov 8, 2021
Messages
3
This is now resolved :smile:


Go to Services > SMB > Configure > Advanced Options > Auxiliary Parameters
Add: path = /mnt/pool/users3/%u
Restart the SMB service

Now when new users SSH into TrueNAS or mount the share from Linux or Windows the new user home directory is created in the correct location.

Note: For Windows you must enter the username using format: $DOMAIN\$user.
Do not use $user@$DOMAIN.
log.smbd will show an error for missing directory: /mnt/$path/$domain/$user_$domain
Using $DOMAIN\$user instead uses the correct directory: /mnt/$path/$domain/$user
 
Top