在 smb.conf 文件中将主机名设置为变量

在 smb.conf 文件中将主机名设置为变量

我想在 smb.conf 文件中输入一个代表“netbios 名称”的变量。我可以使用 %U 将“主目录”设置为变量,我可以使用什么来对“netbios 名称”执行相同的操作?

答案1

如果你输入,man 5 smb.conf你会看到可以替换的变量的完整列表,包括%m:-

%m 客户端机器的 NetBIOS 名称(非常有用)。

This parameter is not available when Samba listens on port 445, as clients no
longer send this information. If you use this macro in an include statement on a
domain that has a Samba domain controller be sure to set in the [global] section
smb ports = 139. This will cause Samba to not listen on port 445 and will permit
include functionality to function as it did with Samba 2.x.

另一个有用的替换是$(envvar),它允许您在配置中使用任何导出的环境变量。

相关内容