LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-21-2021, 10:59 AM   #1
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Rep: Reputation: 0
Samba save file access from Linux (Solved)


Hello All

I am running a Pi4 with Buster.

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
 
Old 11-21-2021, 11:42 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.
 
Old 11-21-2021, 02:24 PM   #3
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Original Poster
Rep: Reputation: 0
Thanks for your reply.

Windows accesses through file explorer and never asked(s) for a username or password.

I get to the server through the file manager in Linux. Again, no request for username or password.
 
Old 11-21-2021, 02:44 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,623

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
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.
 
Old 11-21-2021, 04:11 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.
 
Old 11-22-2021, 03:58 PM   #6
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Original Poster
Rep: Reputation: 0
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.

Culled my smb.conf share to this:

[shared]
path = /home/pi/shared
browseable = yes
writeable = yes
create mask = 0777
directory mask = 0777
public = no

I know it is a permissions issue but Linux worked fine with the old buster. I have no idea where to go from here.
 
Old 11-22-2021, 05:22 PM   #7
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by rick0612 View Post
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.

Culled my smb.conf share to this:

[shared]
path = /home/pi/shared
browseable = yes
writeable = yes
create mask = 0777
directory mask = 0777
public = no

I know it is a permissions issue but Linux worked fine with the old buster. I have no idea where to go from here.
See if this helps...
https://wiki.samba.org/index.php/Set...share_settings
This may also be of interest...
https://www.techrepublic.com/article...ng-with-samba/

BTW, can you show us the current permissions?
Code:
ls -ld /home/pi/shared
 
Old 11-22-2021, 06:07 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Another blog of interest...
https://work-work.work/blog/2018/12/...rity-mask.html
Validated by...
https://www.samba.org/samba/docs/cur...ORCECREATEMODE
 
Old 11-22-2021, 06:34 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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
 
Old 11-22-2021, 06:36 PM   #10
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Original Poster
Rep: Reputation: 0
The output of ls -ld /home/pi/shared is:

drwxrwxrwx 3 pi pi 4096 Nov 22 15:10 /home/pi/shared
 
Old 11-22-2021, 06:46 PM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by michaelk View Post
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?
Code:
unix extensions = no
 
Old 11-22-2021, 06:57 PM   #12
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Original Poster
Rep: Reputation: 0
Tried:

force create mode = 0777 no help

unix extensions = no no help



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.
 
Old 11-22-2021, 07:41 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
No changes with unix extensions.

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.
 
Old 11-22-2021, 09:52 PM   #14
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,803

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
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

Last edited by ferrari; 11-22-2021 at 09:58 PM.
 
Old 11-23-2021, 09:29 AM   #15
rick0612
LQ Newbie
 
Registered: Jan 2006
Posts: 25

Original Poster
Rep: Reputation: 0
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.

Should I mark this solved?

Thanks for all your inputs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The 'Save-File' & 'Save-Folder' explained... Mike_Walsh Puppy 3 08-21-2017 07:06 PM
FATDOG64 - save file not showing its USB stick to save to. BW-userx Puppy 2 10-25-2016 10:02 AM
Iceweasel Browser Cannot save pages/ save any file/download Dhanraj C Linux - Newbie 2 07-22-2015 07:09 PM
With zfs on linux, how do you save a file as xattr file under a normal zfs file? wzis Linux - Software 0 07-03-2015 12:45 PM
[SOLVED] Transferring from save file to save partition hda7 Puppy 2 05-04-2010 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration