samba4 配置问题

[global]
	workgroup = SAMBA
	security = user

	passdb backend = tdbsam

	printing = cups
	printcap name = cups
	load printers = yes
	cups options = raw
     
        logfile = /var/log/samba/%U.log
        maxlogsize = 50

        username map = /etc/samba/smbusers

	client ipc min protocol = SMB3
	vfs objects = catia fruit recycle streams_xattr
	fruit:metadata = stream
	fruit:model = MacSamba
	fruit:posix_rename = yes 
	fruit:veto_appledouble = no
	fruit:wipe_intentionally_left_blank_rfork = yes 
	fruit:delete_empty_adfiles = yes
	access based share enum = yes	

[private]
	comment = user private dir
	path = /data/%U
	invalid users = @sambaguestgroup
	valid users = %U(也试了%S)
	force user = %U(也试了%S)
	writeable = Yes
	browseable = Yes
	create mask = 0600
	directory mask = 0700
	recycle:keeptree = yes
	recycle:versions = yes
	recycle:touch = no
	recycle:touch_mtime = no

想请教一下高手,这个配置在 openSUSE 跑不通,在 Debian 和 CentOS 上能跑通,是为什么呢? :hear_no_evil:

用的是 openSUSE Leap 15.4,在风滚草上试过也不行

关防火墙试试

感谢回复,确认防火墙已关闭,主要是『path』这个值的影响,不用%U 就可以共享,用了%U 这种变量就只能看到目录,不能进入,进入就报错。
具体报什么错在服务器上也不知道看哪里的 log 才能排查问题。

[private] 这种段名是从哪看到的?

我在 Leap15.4 上的 samba 4.15 里,man 5 smb.conf 并没有看到配置文件有这个段。

咦,段名不是可以随便设置的吗?

查了一下好像说是从 4.14 之后就因为安全原因不能再随便设置变量了,要用新的规则
`path

The path to the directory that is to be shared. If this parameter is not specified, the share will be based on the user’s home directory. The path parameter can be an absolute path or a relative path. If a relative path is specified, it will be interpreted relative to the current working directory of the user who is connecting to the share.

In Samba 4.14 and later, the path parameter must be an absolute path. This is because the path parameter is now used to specify the exact location of the share directory. Variables are not allowed in absolute paths.`

不好意思,反而是您提醒了我 – 段名确实是可以随便设置的,但 path 确实是某个版本之后不能随便设置了。 谢谢哈!

1赞