大网数据广告活动
服务器运维问答

Samba share not accessible to client in the same network

· 52CE 我爱测

Two servers in the same network, a Windows server (client), and a Linux server (samba share host) The shared folder can be seen by the client but not accessed. See below for the configuration: smb.conf: [global] workgroup = SAMBA…

问题原文

原帖链接 · Tango · CC BY-SA 4.0

Two servers in the same network, a Windows server (client), and a Linux server (samba share host)

The shared folder can be seen by the client but not accessed. See below for the configuration: smb.conf:

[global]
        workgroup = SAMBA
        security = user
        hosts allow = 192.168.1.40 #(windows server)
        passdb backend = tdbsam
        bind interfaces only = yes
        netbios name = test-server
        server role = standalone server
        log file = /var/log/samba/%m
        log level = 1


[testshare]
  path = /home/smbuser/testshare
  read only = no
  guest ok = yes
  guest only = yes
/home/smbuser/testshare:

drwxrwsrwx. 2 smbuser examplegroup   6 Sep  6 16:34 testshare

Firewalls are disabled on both sides.

Windows gives the error:

Windows cannot access \\192.168.1.20\testshare

You do not have permission to access \\192.168.1.20\testshare

已采纳解答

原帖链接 · Chris Davies · CC BY-SA 4.0

You've got two issues here

  1. You're trying to access \192.168.1.20\testshare instead of \\192.168.1.20\testshare. I'm going to assume that's a typo but it's important to be precise

  2. You have a hosts allow = 192.168.1.20 entry in the smb.conf. The documentation (man smb.conf) describes this value as "This parameter is a […] set of hosts which are permitted to access a service". However, from your Windows client you're trying to access a server on address 192.168.1.20, showing that your client can't be 192.168.1.20. As a result any service will be refused.

    Temporarily, remove the hosts allow entry (comment it out) and test that you have connectivity. When you have confirmed this, put the line back but with the correct client IP address.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2023-09-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。