1

I'm running a CentOS server with Samba. Connected on the LAN is one Windows 7 PC and the rest are Macs and Linux. The Macs don't have this problem, but on the Windows PC when a user attempts to move a file on the same share from one folder to another, it doesn't "move" them. It makes a copy of the file to the destination and doesn't remove the source file.

This doesn't happen all the time, but it seems to be happening more when the file is created from one of the Macs (all running El Capitan). The problem has not occurred when the PC user moves a file they have created.

What can I try to trouble-shoot this?

Could this be an issue with the smb.conf file? How should it be set-up so that all users of the file server have read/write access to all the files on the share?

I find this very puzzling that it doesn't seem to be happening all the time, even though the files have the same owner/group and permissions.

Is there something I need to do on Windows 7 to make sure the client on there is working currently?

CentOS release 6.7 (Final) Samba version 3.6.23-24.el6_7

The share is 0755 permissions and is owned by smbuser and smbuser group.

The folder in the share has a permission of 0775, same owner/group as above.

The actual file has a permission of 0644 and is owned and belongs to group root. However in the smb.conf file, everything is forced to root (I believe):

[global]
        workgroup = workgroup
        netbios name = SERVER
        browseable = no
        available = no
        wins support = yes
        local master = yes

[SERVER]
        comment = File Server
        browseable = yes
        valid users = smbuser,nobody,edward
        force user = root
        writeable = yes
        path = /home/share
        available = yes

Everyone (on the Macs) has access through user smbuser with the same password.

The Windows 7 PC, which I'm not entirely sure about since it has been so long since I set it up, I thought it was also using smbuser too. But now I can't find where that information is on the PC to verify this, or wipe it out and re-enter it. But if everyone is "force user = root" doesn't that mean, they would all be acting as "root"?

I have done a test where the PC created a folder and file on the share, and it is owned by root and the same group.

If I don't have this set-up properly, please let me know. We need all workstations to be able to read/write the same files. There is no reason for it to belong to a specific user.

Edward_178118
  • 955
  • 4
  • 15
  • 33
  • Sounds like the original file cannot be deleted (may be silently ignored). Might the Mac that originally had tihe file open, still have the file open? – Thorbjørn Ravn Andersen Feb 28 '16 at 19:08
  • What version of Samba is the CenOS running? What are the permissions on the share, files, and folders? The directory permissions grant the ability to remove any files in the directory. It could be that the user doesn't have permission to remove from a directory but does have permission to read and create in another directory. – NoelProf Feb 28 '16 at 19:36
  • @ThorbjørnRavnAndersen I was able to shut down after hours all other users, and no one else could have had the file open. However, when I returned to a Mac I was easily able to move the files and it behaved normally. – Edward_178118 Feb 29 '16 at 15:06
  • @NoelProf Please see my update. – Edward_178118 Feb 29 '16 at 15:07

1 Answers1

0

A couple ways to trouble-shoot the Samba behavior you're describing.

  1. Enable Samba auditing. Blog entry on Samba – file audit log with full_audit
  2. Use strace to trace the system calls from the user's smbd process. Chapter 14 of the Samba Developer's guide describes Tracing samba system calls
  3. the samba utility smbstatus will show current samba connections and oplocks.
NoelProf
  • 130
  • 5
  • Thanks. Would this full audio include each time a file on the share is accessed along with error messages, such as it wouldn't be able to write or doesn't have permission? Also, is this thing very verbose? I'd like to leave it running until we have this problem again, just want to make sure it isn't slowing down the server too much. – Edward_178118 Feb 29 '16 at 15:08
  • 1
    Auditing is very configurable. We leave auditing on for auditing users and security issues. Auditing can show error messages like can't open, ect. – NoelProf Mar 01 '16 at 01:25