带有 Fedora 客户端的 Debian 服务器上的 Samba 权限

带有 Fedora 客户端的 Debian 服务器上的 Samba 权限

我有一台通过 Samba 共享文件的 Debian 服务器。我可以通过 Windows 毫无问题地访问文件,但当我尝试使用相同凭据在 Fedora 客户端上安装共享时,我无法写入任何文件。我有适当的读取权限,但没有写入权限。

以下是我的 smb.conf 中的共享设置:

[lampp]
path = /opt/lampp
writable = yes
browsable = yes

我不得不假设这是 Fedora 方面的问题,因为从 Windows 访问共享可以正常工作。我也尝试过通过 SSHFS 进行安装,但没有成功;它还允许我读取文件但不允许写入。然而,在 Windows 中,使用名为 WebDrive 的程序,我可以访问文件(基本上是通过 SSHFS),没有任何问题。

我曾尝试设置 NFS,但运气也不好;如果可能的话,我宁愿坚持使用 Samba。

有什么建议么?

答案1

我已经在这里回答过非常类似的问题。请看一看:如何使新复制的文件始终具有 777 权限

问题肯定出在权限上。Windows 对权限的理解很模糊,但 Linux 会比较访问文件的用户的 UID 和文件所有者的 UID。仅以同名用户身份登录是不够的,UID 必须正确。这可以通过在 smbmount 中设置 uid 和 gid 选项来实现。

例如:

smbmount //server/share /mount_point -o uid=1023,gid=1000

问候,

马丁

答案2

我猜是目录本身的权限问题。十有八九我都会忘记更改这些权限。

答案3

我还有一些分区与 samba 共享。samba 服务器位于运行 Unstable 的 Debina 机器上。我注意到我需要拥有smbuser group.

我使用下面显示的命令访问共享目录。

$> smbmount  //SambaServer/Share1 ~/mnt/S1 -o user=mysername

where SambaServer is the name of the host runnign the Samba server, Share1 is the name of the partition to be shared on it, ~/mnt/S1 is the directory where I want to mount the shared folder and mysername is my username on the Samba server machine.

On the Samba server machine, I have the following stanza in /etc/samba/smb.conf:


[Share1]
        comment = Shared folder 1
        browsable = yes
        guest ok = no
        path = /media/Share1
        writable = yes
        force create mode = 0770
        force directory mode = 0775

And the permissions of /media/Share1 are: drwxrwsr-x owned by root:smbuser

祝你好运。

相关内容