Hi guys,
I’m trying to do something quite trivial, but it doesn’t work as I expect and I really don’t have a clue why is that.
In order to work on a clean system I tried all of these tests with TrueNAS appliance running on VirtualBox VM.
Here is my pool:
root@truenas:~# zfs list | grep mnt
Tank 1.23G 15.7G 104K /mnt/Tank
Tank/Share 96K 15.7G 96K /mnt/Tank/Share
boot-pool/ROOT/24.04.0/mnt 96K 25.3G 96K /mnt
root@truenas:~#
In order to keep the things really simple and don’t mess with ACLs I decided to create standard (general) type of dataset, check this out:
When I click on edit of the SMB share I see “Default Share Parameters”:
On a Unix Permission Editor I see:
If I try to locally create a new file or folder with the mentioned user, all good:
test1@truenas:/mnt/Tank$ cd Share/
test1@truenas:/mnt/Tank/Share$ mkdir Zz
test1@truenas:/mnt/Tank/Share$ touch Zz/Aa
test1@truenas:/mnt/Tank/Share$ ls -la
total 2
drwxrwx--- 3 test1 test1 3 May 8 08:42 .
drwxr-xr-x 5 root root 5 May 8 08:20 ..
drwxr-xr-x 2 test1 test1 3 May 8 08:42 Zz
test1@truenas:/mnt/Tank/Share$ ls -la Zz/
total 2
drwxr-xr-x 2 test1 test1 3 May 8 08:42 .
drwxrwx--- 3 test1 test1 3 May 8 08:42 ..
-rw-r--r-- 1 test1 test1 0 May 8 08:42 Aa
test1@truenas:/mnt/Tank/Share$
But if I try to to the same over Samba I got “Permission denied”
kpucko@elementaryOS:~$ sudo mount -t cifs -o username=test1,password=test1 //192.168.56.107/Share /mnt
[sudo] password for kpucko:
kpucko@elementaryOS:~$ mkdir /mnt/Aa
mkdir: cannot create directory ‘/mnt/Aa’: Permission denied
kpucko@elementaryOS:~$
You would say, did you restarted the Samba service?
And yes, I did it:
root@truenas:~# systemctl restart smbd
root@truenas:~# systemctl status smbd
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-05-08 08:45:40 PDT; 1s ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Main PID: 64212 (smbd)
Status: "smbd: ready to serve connections..."
Tasks: 3 (limit: 9139)
Memory: 6.9M
CPU: 59ms
CGroup: /system.slice/smbd.service
├─64212 /usr/sbin/smbd --foreground --no-process-group
├─64214 "smbd: notifyd" .
└─64215 "smbd: cleanupd "
May 08 08:45:40 truenas systemd[1]: smbd.service: Deactivated successfully.
May 08 08:45:40 truenas systemd[1]: Stopped smbd.service - Samba SMB Daemon.
May 08 08:45:40 truenas systemd[1]: Starting smbd.service - Samba SMB Daemon...
May 08 08:45:40 truenas systemd[1]: Started smbd.service - Samba SMB Daemon.
root@truenas:~#
The result is the same
Samba4 testparam command looks like expected, except the fact there is nothing about my user test1:
root@truenas:~# testparm
Load smb config files from /etc/smb4.conf
lpcfg_do_global_parameter: WARNING: The "syslog only" option is deprecated
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
bind interfaces only = Yes
disable spoolss = Yes
dns proxy = No
load printers = No
logging = file
max log size = 5120
passdb backend = tdbsam:/var/run/samba-cache/private/passdb.tdb
printcap name = /dev/null
registry shares = Yes
restrict anonymous = 2
server multi channel support = No
server string = TrueNAS Server
winbind request timeout = 2
idmap config * : range = 90000001 - 100000000
fruit:zero_file_id = false
fruit:nfs_aces = false
rpc_server:mdssvc = disabled
rpc_daemon:mdssd = disabled
idmap config * : backend = tdb
create mask = 0775
directory mask = 0775
[Share]
ea support = No
path = /mnt/Tank/Share
posix locking = No
read only = No
smbd max xattr size = 2097152
vfs objects = streams_xattr shadow_copy_zfs acl_xattr zfs_core io_uring
tn:vuid =
fruit:time machine = False
tn:home = False
tn:path_suffix =
fruit:time machine max size = 0
tn:purpose = DEFAULT_SHARE
root@truenas:~#
Any ideas are welcomed.
Thanks in advance.