我在 Netgear R7000 上使用 freshtomato,我想把它当成时间机器,所以我安装了Samba
和Avahi
,这样我就可以在 macOS 的系统偏好设置中找到我的硬盘。但是,mac 一直问我服务器的名称和密码。所以我检查了 freshtomato 的日志。我发现了日志:
Jul 5 13:47:57 daemon err smbd[31405] parse_dfs_path_strict: Hostname findyy._smb._tcp.local is not ours.
Jul 5 13:47:57 daemon err smbd[31405] parse_dfs_path_strict: Hostname findyy._smb._tcp.local is not ours.
Jul 5 13:47:57 daemon err smbd[31405] parse_dfs_path_strict: can't parse hostname from path \findyy._smb._tcp.local
这是我的 Samba 配置:
[global]
log file = /var/log/samba/log.%m
interfaces = br0
hosts allow = 10.0.0.25
remote announce = findyy.local
bind interfaces only = yes
enable core files = no
deadtime = 30
smb encrypt = disabled
min receivefile size = 16384
workgroup = WORKGROUP
netbios name = findyy
server string = FreshTomato Samba Server
dos charset = ASCII
unix charset = UTF8
guest account = nobody
security = user
guest ok = no
guest only = no
browseable = yes
timestamp logs = no
passdb backend = smbpasswd
preserve case = yes
short preserve case = yes
load printers = no
printing = bsd
printcap name = /dev/null
map archive = no
map hidden = no
map read only = no
map system = no
store dos attributes = no
dos filemode = yes
strict locking = no
oplocks = yes
level2 oplocks = yes
kernel oplocks = no
use sendfile = yes
wins support = no
max protocol = SMB2
domain master = yes
local master = yes
preferred master = yes
os level = 255
socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
[Time_Machine]
path = /tmp/mnt/Time_Machine
comment = Time_Machine
writable = yes
delete readonly = yes
force user = root,findyy
vfs objects = catia fruit streams_xattr
fruit:time machine = yes
这是我的配置Avahi
:
[server]
host-name=findyy
domain-name=.alocal
use-ipv4=yes
use-ipv6=yes
check-response-ttl=no
use-iff-running=no
#enable-dbus=0
[publish]
publish-addresses=yes
publish-hinfo=yes
publish-workstation=no
publish-domain=yes
[reflector]
enable-reflector=no
reflect-ipv=no
[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=30
rlimit-stack=4194304
rlimit-nproc=3
这是服务的配置Avahi
:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>9</port>
<txt-record>model=TimeCapsule8,119</txt-record>
</service>
<service>
<type>_adisk._tcp</type>
<port>9</port>
<txt-record>dk0=adVN=Time_Machine,adVF=0x82</txt-record>
<txt-record>sys=adVF=0x100</txt-record>
</service>
</service-group>
答案1
该问题似乎是 Samba 配置问题,导致出现以下错误。
parse_dfs_path_strict:无法从路径解析主机名
问题的根源似乎是 smb.conf 的配置错误。smb.conf 允许强制用户和组进行共享。如果主机上不存在用户或组或权限不正确,则在连接时会出现该问题。将其更改为具有正确共享权限的有效用户似乎可以解决问题。
[share]
force group = "username"
force user = "username"
path = /path
valid users = "username"