简单的 Samba 文件共享

简单的 Samba 文件共享

我正在尝试设置一个简单的 ubuntu (14.04 lts) 文件服务器,以允许网络上的 win xp 和 osx 机器对共享具有读写权限,而无需使用密码进行身份验证。

我已遵循此处的说明:https://help.ubuntu.com/14.04/serverguide/samba-fileserver.html尽管我可以在网络上看到该服务器,但我无法成功写入它。

实际上,在 XP 机器上,我可以创建一个文件夹,并且它确实在服务器上创建了一个具有默认名称(新文件夹)的文件夹,但尝试打开该文件夹时出现以下错误:

\\Srv1\share\New Folder is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions

The specified network name is no longer required

尝试重命名该文件夹时出现以下错误:

Cannot rename file: Cannot read from the source file or disk

运行 testparms 得到以下输出:

    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    WARNING: The "syslog" option is deprecated
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[share]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE

    Press enter to see a dump of your service definitions

    # Global parameters
    [global]
        server string = %h (SRV1)
        server role = standalone server
        security = USER
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb


    [printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        browseable = No


    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers


    [share]
        comment = test-share
        path = /srv/samba/share
        read only = No
        create mask = 0777
        guest ok = Yes

这是共享文件夹:

dvsu@srv1:/etc/samba$ ll /srv/samba/
total 12
drwxrwxrwx 3 root   root    4096 May  4 14:01 ./
drwxr-xr-x 3 root   root    4096 May  4 14:01 ../
drwxrwxrwx 4 nobody nogroup 4096 May  4 14:38 share/
dvsu@srv1:/etc/samba$ 

任何帮助都非常感谢。

谢谢

答案1

添加browseable = yes[share]smb.conf 中的块以允许 Windows 计算机成功浏览共享。它应该可以解决客户端可以写入但不能读取的问题。更改配置文件后,重新启动 samba 服务:

sudo restart smbd
sudo restart nmbd

相关内容