Centos 6.5 Samba 3您没有得到用户的许可

时间:2014-03-11 03:04:57

标签: centos6 samba

我想在使用samba将 centos 6.5 中的文件复制到 windows 7 文件夹时出错。 这是错误消息:

you need permission to perform this action
You require permission from ERP\hao to make change to this file.

[global]
    workgroup = MYGROUP
    server string = Samba Server Version %v
    log file = /var/log/samba/log.%m
    # max 50KB per log file, then rotate
    max log size = 50
    security = user
[erp]
    comment = ERP
    path = /opt/erp
    public = yes
    writable = yes
    printable = no
    browseable = no
    create mask = 0777
    create mode = 0777
    directory mode = 0777
    share modes = yes
    force user = hao
    force group = hao
    read only = no

我要复制位置的文件:

  

的/ opt / ERP / MVE

我的桑巴路径

  

的/ opt / ERP

[hao@erp mve]$ stat -c '%a %n' *
777 7841e10a957d4bceb2205632c49543af.ygk
777 p18i13847jgnl1s91kujqlh1t9c3.ygk

[hao@erp erp]# ls -l mve/
-rwxrwxrwx. 1 hao hao  63467455 Mar 10 21:38 7841e10a957d4bceb2205632c49543af.ygk
-rwxrwxrwx. 1 hao hao 111912448 Mar 10 21:46 p18i13847jgnl1s91kujqlh1t9c3.ygk

[root@erp erp]# smbd --version
Version 3.6.9-167.el6_5


[hao@erp erp]# ls -l
drwxrwxrwx.  2 hao hao       4096 Mar 11 09:42 mve

我可以复制/ opt / erp中的所有文件,除了在mve文件夹中。 请帮忙,如何解决这个问题。请指教。谢谢。

2 个答案:

答案 0 :(得分:0)

使用CentOS 6.5时,这对我在Windows 7上起作用。

http://rbgeek.wordpress.com/2012/05/25/how-to-install-samba-server-on-centos-6/

指示略有变化..

  1. 工作组需要根据您的具体情况进行更改(在/etc/samba/smb.conf中设置值)。
  2. 在Windows上使用\\192.168.x.x\代替\\centos
  3. 您需要创建文件夹/samba/samba/share并相应地设置权限。
  4. 如果您的操作系统没有nano(按照说明),请在开始之前安装... yum install nano
  5. 两次运行重启命令(其中2个),因为关闭不适用。确保两者都没问题。

答案 1 :(得分:0)

我遇到了类似的问题,结果发现它与SELinux安全上下文有关。

我必须运行命令chcon -t samba_share_t /<path>/<to>/<share> -R

现在我可以在共享文件夹中创建和更改文件。