@smokinjo Don't know if you've sorted this out but this page gets to the basics and avoids getting bogged down in the fine detail:
https://wiki.samba.org/index.php/Mounting_samba_shares_from_a_unix_client
In the way of an example, to show available SAMBA shares in linux, use smbclient or smbtree:
Code:
root@bunsen-vm:~# smbtree -b -N
WORKGROUP
\\FREENAS FreeNAS Server
\\FREENAS\IPC$ IPC Service (FreeNAS Server)
\\FREENAS\nas_share
\\FREENAS\homes Home Directories
\\FREENAS\a_share
root@bunsen-vm:~# smbclient -L 192.168.0.114 -U%
WARNING: The "syslog" option is deprecated
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.7.0]
Sharename Type Comment
--------- ---- -------
a_share Disk
homes Disk Home Directories
nas_share Disk
IPC$ IPC IPC Service (FreeNAS Server)
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.7.0]
Server Comment
--------- -------
FREENAS FreeNAS Server
Workgroup Master
--------- -------
WORKGROUP FREENAS
In this case the zfs dataset shared as "a_share" is owned by user chris (uid 1000, gid 1000) on FreeNAS.
A manual non-persistent:
Code:
root@bunsen-vm:~# mount -v -t cifs -o user=chris,uid=1000,gid=1000,credentials=/home/chris/creds/smb //192.168.0.114/a_share /home/chris/CIFS
mount.cifs kernel mount options: ip=192.168.0.114,unc=\\192.168.0.114\a_share,uid=1000,gid=1000,user=chris,pass=********
root@bunsen-vm:~#
Check actual full mount arguments used, including default arguments:
Code:
root@bunsen-vm:~# mount | grep CIFS
//192.168.0.114/a_share on /home/chris/CIFS type cifs (rw,relatime,vers=1.0,cache=strict,username=chris,domain=FREENAS,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.0.114,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=65536,echo_interval=60,actimeo=1,user=chris)
root@bunsen-vm:~#
Note with a vers=1.0 mount the "unix" agrument means Unix extension is understood and data will have the unix perms as on dataset. With higher SAMBA versions, Unix extension are not understood and a file_mode & dir-Mode of 0755 is forced - ie. DOS like perms, e.g:
Code:
root@bunsen-vm:~# mount -v -t cifs -o vers=3.0,user=chris,uid=1000,gid=1000,credentials=/home/chris/creds/smb //192.168.0.114/a_share /home/chris/CIFS
mount.cifs kernel mount options: ip=192.168.0.114,unc=\\192.168.0.114\a_share,vers=3.0,uid=1000,gid=1000,user=chris,pass=********
root@bunsen-vm:~# mount | grep CIFS
//192.168.0.114/a_share on /home/chris/CIFS type cifs (rw,relatime,vers=3.0,sec=ntlmssp,cache=strict,username=chris,domain=FREENAS,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.0.114,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1,user=chris)
root@bunsen-vm:~#
In this example, the user "chris" exists on both FreeNAS and Linux with the same uid/gid. The username/password combo SAMBA authenticates against must be that of a valid SAMBA account on FreeNAS. (in my example "bunsen-vm" is a debian based desktop)
Once you sorted out how you want to mount the FreeNAS SAMBA share in linux, then convert your manual mount command into a "/etc/fstab" entry for a peristent mount.