File Share Problem Between SAMBA AND WINDOWS 7

Home » CentOS » File Share Problem Between SAMBA AND WINDOWS 7
CentOS 5 Comments

hi,

i have installded samba 4 onCentOS 7 and started to use as part of active directory. But i have a problemabout sharing files between samba and windows 7.

i can browse and edit sharedfiles and folders on windows 7. But when i create a new folder, the owner of the folder is seen as “#User300012”instead of the real samba user.

My sharing steps

1-     i have add a user named “ege” on CentOS and addhim on samba with smbpasswd -a ege

2-     and iedited the permissions of the home folder of  “ege” with chmod 777

3-     mysmb.conf file

 
[homes]
browseable = yes writeable = yes valid users = %S
read only = No

4-     i logged on Windows 7 with user SERVER\ege, andi can browse shared folders. But when i create a folder in shared folder on Windows7 the owner of the folder is seen as “#User300012”. but the user name is “ege”on CentOS and samba.

How can i fix thisowner of folder problem. Because of this problem i can’t use the quota forusers.

5 thoughts on - File Share Problem Between SAMBA AND WINDOWS 7

  • Erkin Aka wrote:

    Question: In Linux, are you sharing these via NFS as well? If so, when it mounts, is it mounted as nobody:nobody?

    If so, you need to fix /etc/idmapd.conf. First, add your Domain =
    . Then, uncomment Method = nssswitch. Finally, comment out the UMICH_SCHEMA.

    After doing that, nfs-idmapd -c clears the cache, and restart nfs-idmapd and autofs. See if that helps.

    Beyond that – I really don’t begin to know samba well enough, but I
    *think* there’s a line in the configuration related to ownership and uids

    mark

  • Are you running winbind? In an AD environment, this is normally the way to map UIDs to windows usernames.

    Do other files owned by “ege” show the correct user ownership?

    What does “getfacl” output for the new folder you created? What does
    “getfacl” output for other files owned by “ege”?

    That’s probably not true. Quota accounting is not dependent on Windows clients’ ability to correctly resolve a UID to a name.

  • Hi, The output is when i run getfacl on a correct folder;
    [root@server1 cafer]# getfacl Public# file: Public# owner: ege# group: gebzememuser::rwxgroup::r-xother::r-x

    And second output; on a folder which was created on windows 7 by ege

    [root@server1 cafer]# getfacl cccc# file: cccc# owner: 3000016# group: 3000021user::rwxuser:3000021:r-xgroup::r-xgroup:3000016:rwxgroup:3000021:r-xmask::rwxother::r-xdefault:user::rwxdefault:user:3000016:rwxdefault:group::r-xdefault:group:3000021:r-xdefault:mask::rwxdefault:other::r-x

    From: Gordon Messmer
    To: CentOS mailing list
    Sent: Tuesday, December 15, 2015 8:08 PM
    Subject: Re: [CentOS] File Share Problem Between SAMBA AND WINDOWS 7

    Are you running winbind?  In an AD environment, this is normally the way to map UIDs to windows usernames.

    Do other files owned by “ege” show the correct user ownership?

    What does “getfacl” output for the new folder you created?  What does
    “getfacl” output for other files owned by “ege”?

    That’s probably not true.  Quota accounting is not dependent on Windows clients’ ability to correctly resolve a UID to a name.

  • Hi, I have tried your suggestion yesterday, i installed nfs-utils which are explained on this url (howtoforge).
    |   |
    |   | |   |   |   |   |   |
    | NFS server and client installation on CentOS 7NFS server and client installation on CentOS 7 This guide explains how to configure NFS server in CentOS 7.0 Network File System (NFS) is a popular d… |
    | |
    | View on http://www.howtoforge.com | Preview by Yahoo |
    | |
    |   |

    But i have mounted my home folder but the i have same problem again. also i have edited my /etc/idmapd.conf file like; 

    [General]#Verbosity = 0# The following should be set to the local NFSv4 domain name# The default is the host’s DNS domain name.Domain = server1.gebzememc.net
    # The following is a comma-separated list of Kerberos realm# names that should be considered to be equivalent to the# local realm, such that @REALM.A can be assumed to# be the same user as @REALM.B# If not specified, the default local realm is the domain name,# which defaults to the host’s DNS domain name,# translated to upper-case.# Note that if this value is specified, the local realm name# must be included in the list!#Local-Realms = 
    [Mapping]
    Nobody-User = egeNobody-Group = ege
    [Translation]
    # Translation Method is an comma-separated, ordered list of# translation methods that can be used.  Distributed methods# include “nsswitch”, “umich_ldap”, and “static”.  Each method# is a dynamically loadable plugin library.# New methods may be defined and inserted in the list.# The default is “nsswitch”.Method = nsswitch
    # Optional.  This is a comma-separated, ordered list of# translation methods to be used for translating GSS# authenticated names to ids.# If this option is omitted, the same methods as those# specified in “Method” are used.#GSS-Methods =  #——————————————————————-## The following are used only for the “static” Translation Method.#——————————————————————-#[Static]
    # A “static” list of GSS-Authenticated names to# local user name mappings
    #someuser@REALM = localuser

    #——————————————————————-## The following are used only for the “umich_ldap” Translation Method.#——————————————————————-#
    [UMICH_SCHEMA]
    # server information (REQUIRED)LDAP_server = server1.gebzememc.net
    # the default search base (REQUIRED)LDAP_base = dc=server1,dc=gebzememc,dc=net
    #———————————————————–## The remaining options have defaults (as shown)# and are therefore not required.#———————————————————–#
    # whether or not to perform canonicalization on the# name given as LDAP_server#LDAP_canonicalize_name = true
    # absolute search base for (people) accounts#LDAP_people_base =
    # absolute search base for groups#LDAP_group_base =

    # Set to true to enable SSL – anything else is not enabled#LDAP_use_ssl = false
    # You must specify a CA certificate location if you enable SSL#LDAP_ca_cert = /etc/ldapca.cert
    # Objectclass mapping information
    # Mapping for the person (account) object class#NFSv4_person_objectclass = NFSv4RemotePerson
    # Mapping for the nfsv4name attribute the person object#NFSv4_name_attr = NFSv4Name
    # Mapping for the UID number#NFSv4_uid_attr = UIDNumber
    # Mapping for the GSSAPI Principal name#GSS_principal_attr = GSSAuthName
    # Mapping for the account name attribute (usually uid)# The value for this attribute must match the value of # the group member attribute – NFSv4_member_attr#NFSv4_acctname_attr = uid
    # Mapping for the group object class#NFSv4_group_objectclass = NFSv4RemoteGroup
    # Mapping for the GID attribute#NFSv4_gid_attr = GIDNumber
    # Mapping for the Group NFSv4 name#NFSv4_group_attr = NFSv4Name
    # Mapping for the Group member attribute (usually memberUID)# The value of this attribute must match the value of NFSv4_acctname_attr#NFSv4_member_attr = memberUID

    From: “m.roth@5-cent.us”
    To: CentOS mailing list
    Sent: Tuesday, December 15, 2015 5:28 PM
    Subject: Re: [CentOS] File Share Problem Between SAMBA AND WINDOWS 7

    Erkin Aka wrote:

    Question: In Linux, are you sharing these via NFS as well? If so, when it mounts, is it mounted as nobody:nobody?

    If so, you need to fix /etc/idmapd.conf. First, add your Domain =
    . Then, uncomment Method = nssswitch. Finally, comment out the UMICH_SCHEMA.

    After doing that, nfs-idmapd -c clears the cache, and restart nfs-idmapd and autofs. See if that helps.

    Beyond that – I really don’t begin to know samba well enough, but I
    *think* there’s a line in the configuration related to ownership and uids

          mark

  • Are you running winbind? In an AD environment, this is normally the way to map UIDs to windows usernames.