I have some python scripts that are on a Samba server. I first used them under Windows and now want to use them on a Linux machine. Therefore I mounted the server folder on my Linux machine (Kubuntu 16.04) using the following:
sudo mount -t cifs //[IP address]/Share Share -o username=guest
Now I want to run the python files in this share directory on the Linux machine. A problem arises when python has to write to files in this directory (I create .PNG files and write to a .CSV file to log my results):
IOError: [Errno 13] Permission denied: 'filename.png'
This makes kind of sense... The permissions of such files are:
-rw-rw-r--+ 1 nobody nogroup
The .PNG file I write to is actually created at that moment. So the result is an empty file with the permissions as above.
Permissions of the files that were already there (created on Windows) are:
-rwxrw-rw-+ 1 nobody nogroup
Can anyone help me out here?
I would want to be able to write to the file. It should still work/be accessible on the windows computer.
I am not sure where the problem is. I don't know why the files are owned by nobody, even if those files were just created. Then the reason for not being able to write to it is of course that the group permissions are read-only and the file is part of nogroup.
I access the same files on a Windows computer (which is not the server) and I can read and write and do whatever I want there just fine.
So my question is then, why are the files owned by nobody and part of nogroup and how do I fix this?
ugo+rw
, the CIFS is declaring that anyone should be able to write to it (though obviously something denies the write when it is actually attempted). It makes sense that you can'tchown
since CIFS doesn't have the concept of file ownership. – DepressedDaniel Jan 10 '17 at 06:39-rw-rw-rw-
which clearly means anyone can read and write. – DepressedDaniel Jan 10 '17 at 21:35