简体   繁体   English

Samba能够复制文件夹但无法复制文件

[英]Samba able to copy folders but unable to copy files

I am currently using CentOS 6.5 and trying to share files over a samba share. 我目前正在使用CentOS 6.5,并尝试通过samba共享共享文件。 On the other machine is Windows 8 x64. 在另一台计算机上是Windows 8 x64。 I am able to transfer folders from Windows to CentOS over without issues but however, when I try to copy a single file over to CentOS, I get permission denied error on Windows. 我可以将文件夹从Windows转移到CentOS,没有问题,但是,当我尝试将单个文件复制到CentOS时,在Windows上出现权限被拒绝的错误。

Permissions of the folder is as follows: 该文件夹的权限如下:

drwxrwxrwx.   5 user01 smbusers  4096 Feb 28 23:23 srv

And the smb.conf: 和smb.conf:

[srv]
        comment = Data
        path = /srv
        browseable = yes
        writable = yes
        read only = no
        valid users = @smbusers
        workgroup = WORKGROUP
        create mask = 0775
        directory mask = 0775

I would like to know what is the problems that is preventing me from copying files over but not folders. 我想知道是什么导致我无法复制文件但无法复制文件夹的问题。 Contents inside the folders get copied over without issues. 文件夹内的内容被复制而没有问题。 Help appreciated. 帮助表示赞赏。 Thanks in advance! 提前致谢!

Try to change the owner of directory/folder where you are going to copy the file in CentOS from Windows, it's usually done by chown command. 尝试更改要从Windows在CentOS中复制文件的目录/文件夹的所有者 ,这通常是通过chown命令完成的。 For example if you want to the change the owner of directory named share from root to your_user_name , you can do this by following command, 例如,如果您要将名为share的目录的所有者从root更改为your_user_name ,则可以通过以下命令进行操作,

sudo chown your_user_name share

This will change the owner of share folder to your login user. 这会将共享文件夹的所有者更改为您的登录用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM