Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On the Pi itself, I can read and write files in a folder. I then shared the folder via samba. I can read the same files from a Linux client but if I change anything and try to save, I get the following error:
Could not rename partial file smb://raspberrypi.local/OUR_STUFF/Rick Stuff/Documents/filename.part.
Please check permissions.
The save operation leaves a filename.part on the server. I have to discard the save. Odd thing is, if I use 'save as' and rename the file, it writes fine.
The same thing happens if I create a file in the server from the Linux client.
Windows 11 client reads and writes with no issues.
The whole directory tree reads 0777 when on the server.
This appears to be a Linux permissions issue but I have no idea where; on the server or on the Linux client.
Here is my samba.conf:
[OUR_STUFF]
comment = shared folder
path = /home/pi/OUR_STUFF
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = yes
guest ok = yes
force user = pi
force group = pi
Any ideas?
Last edited by rick0612; 12-02-2021 at 06:11 AM.
Reason: Solved
As far as I know Windows guest access to a remote share was disabled in version 10 (1709) so I assume you are connecting as user pi with a password. That would mean the client would have full read/write permissions as user pi.
How are you accessing the share from a linux computer? via file browser or manually mounting? Are you entering a username and password? It would make sense that you are accessing the share as guest and can read but probably not write to existing files owned by pi.
Keep in mind that with SAMBA shares the server permissions and ownership overrides everything else, but restrictions can also be set in the SAMBA share or global configurations. The most restrictive permissions win.
This may not even apply here, I am not running SAMBA on a RPi so I cannot run tests, but I thought it worth mentioning.
It depends on the linux file browser itself and version but it probably asked for username and password (or anonymous aka guest) the first time you connected and you might of selected to remember it forever. The same goes for Windows, there is a select box for remember username and password that is usually checked by default.
You can also check the samba logs and see who connects to the share. I agree it is a permission issue and in my opinion there is no reason to connect using guest if that is the case.
I'm getting frustrated with this.
A little back history. I saw that pi had an update to bullseye so I went ahead and installed it. That's when everything went to crap. Could not for the life of me get samba to do anything with bullseye. Went back to buster and now can't get samba working on it correctly.
My biggest mistake was overwriting buster on my original sd card with bullseye. Word of warning to the wise, use a different sd card if you can.
Anyway what I just now did was install buster pi on a new sd card to start fresh.
Installed samba 4.9.5 and set up my pi user as a samba user with password. Both Windows and Linux can log in to samba share. Windows can read, write, create directories and files and save and delete same. Linux can do all that but cannot save file. Linux can create text file write to it but cannot save it. The error message in the op still pops up in Linux.
I'm getting frustrated with this.
A little back history. I saw that pi had an update to bullseye so I went ahead and installed it. That's when everything went to crap. Could not for the life of me get samba to do anything with bullseye. Went back to buster and now can't get samba working on it correctly.
My biggest mistake was overwriting buster on my original sd card with bullseye. Word of warning to the wise, use a different sd card if you can.
Anyway what I just now did was install buster pi on a new sd card to start fresh.
Installed samba 4.9.5 and set up my pi user as a samba user with password. Both Windows and Linux can log in to samba share. Windows can read, write, create directories and files and save and delete same. Linux can do all that but cannot save file. Linux can create text file write to it but cannot save it. The error message in the op still pops up in Linux.
While not exactly the same I have debian 11 VirtualBox virtual machine which runs samba 4.13.13. If I setup a similar share as #7 with a username/password as my real user this is what I see.
If I create a new directory from the file browser on the host which runs CentOS and create a directory on the debian 11 itself the permissions do match as expected. If I create a new text document from the host it isn't 0777 but don't know why at the moment. I can edit and save existing documents created in the VM from the host.
Code:
drwxrwxrwx 2 me me 4096 Nov 22 18:01 ../new_folder
drwxr-xr-x 2 me me 4096 Nov 22 18:01 ../test
-rwxrw-rw- 1 me me 19 Nov 22 18:07 test2.me
-rwxrw-rw- 1 me me 30 Nov 22 18:04 test.me
While not exactly the same I have debian 11 VirtualBox virtual machine which runs samba 4.13.13. If I setup a similar share as #7 with a username/password as my real user this is what I see.
If I create a new directory from the file browser on the host which runs CentOS and create a directory on the debian 11 itself the permissions do match as expected. If I create a new text document from the host it isn't 0777 but don't know why at the moment. I can edit and save existing documents created in the VM from the host.
Code:
drwxrwxrwx 2 me me 4096 Nov 22 18:01 ../new_folder
drwxr-xr-x 2 me me 4096 Nov 22 18:01 ../test
-rwxrw-rw- 1 me me 19 Nov 22 18:07 test2.me
-rwxrw-rw- 1 me me 30 Nov 22 18:04 test.me
Hmmm...does the following samba directive change that behaviour?
I'm beginning to suspect this may not be a permissions thing. Remember that when trying to save using Linux client, there is a partial file left over. I checked the permissions on that file and they are 777. Don't know if that has any bearing on this case.
What application are you using to create / edit a file? What are the partial file names?
Some applications will create temporary files inside the same directory as the original file which may not may not get deleted when the original is closed. oplock files may or may mot be created.
Another directive that can impact on multi-user access behaviour...
Quote:
inherit permissions (S)
The permissions on new files and directories are normally governed by create mask, directory mask, force create mode and force directory mode but the boolean inherit permissions parameter overrides this.
New directories inherit the mode of the parent directory, including bits such as setgid.
New files inherit their read/write bits from the parent directory. Their execute bits continue to be determined by map archive, map hidden and map system as usual.
Note that the setuid bit is never set via inheritance (the code explicitly prohibits this).
This can be particularly useful on large systems with many users, perhaps several thousand, to allow a single [homes] share to be used flexibly by each user.
Default: inherit permissions = no
For example:
Code:
[shared]
path = /home/pi/shared
browseable = yes
writeable = yes
public = no
inherit permissions = yes
Found that KDE Dolphin ver. 21.08.3 appears to be the problem here. Ran a PC with an older version of Dolphin 20.12.2 and it had no problems at all. Submitted a bug report to them. Waiting on a reply.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.