Share Folders using Samba in Home Network with Mint 21

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Share Folders using Samba in Home Network with Mint 21

Post by altair4 »

Nope. Samba will not update permissions on the parent folder of the shared folder so all will not be well.

You didn't read Part 3 of this Tutorial:
altair4 wrote: Sun Jul 17, 2022 7:00 am Part 3: Creating a Samba Share from Nemo
....
....

Ubuntu changed the default permissions on home folders from 755 to 750 so only the owner of the home folder can access anything under it. This is true locally and across the network.

If you are using Cinnamon and try to create a share of your Public folder for example through Nemo you will get this warning:
The permissions for /home/altair
prevent other users from accessing this share
It will still create the share but access for anyone other than you will not be possible.

There are 4 ways around this problem:
....
....
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
lsemmens
Level 11
Level 11
Posts: 3951
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Share Folders using Samba in Home Network with Mint 21

Post by lsemmens »

You may well be correct, however the folders that I were attempting to share were subfolders of Documents along with Music and Downloads. I can now log on to all of those as "guest" but they all threw the "permissions" message.

FWIW I do "Force the user" as per Part 3 item 3.
Fully mint Household
Out of my mind - please leave a message
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Share Folders using Samba in Home Network with Mint 21

Post by altair4 »

As stated in this Tutorial the preferred way to create shares is not through Nemo / Caja / Nautilus but through samba itself directly:

Code: Select all

[Documents]
path = /home/altair/Documents
read only = no
guest ok = yes
force user = altair
That eliminates the /home/$USER permissions issue and allows all saved files made by the "guest" samba client user appear to be owned by altair ( in this example ) and not "nobody".

Just remember not to use the "Nemo" method and the "samba" method at the same the same time on the same folder as samba is likely to short circuit/
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
modus-modus
Level 1
Level 1
Posts: 28
Joined: Tue Feb 13, 2024 9:24 am
Location: italy

Re: Share Folders using Samba in Home Network with Mint 21

Post by modus-modus »

I configured Samba by editing the smb configuration file as suggested by Altair4 part.2. The exchange of files from PC to iPhone works but from iPhone to PC the file is copied with a size of 0 bytes and the message of file name too long or with invalid characters appears, in reality even when copying a doc.pdf file from the same error even if there are no special characters. I can't understand how this is possible. The connection works correctly. I even managed to transfer a file but then it no longer worked from iPhone to PC despite being connected. I also tried to change the password but nothing.Incredible, if I copy the file into the disk decipher app (the replacement for veracrypt for IOS) and from disk decipher I share the file by saving it in the shared Mint folder, the transfer happens correctly. If I share the file from the IOS file manager in the shared folder, however, the transfer does not take place, only the name of the file is transferred but the size is 0 Kb and the message that the file is too long or has invalid characters appears
Lenovo ideapad i5 8gb ram linux Mint 21.3 Cinnamon
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Share Folders using Samba in Home Network with Mint 21

Post by AndyMH »

iAnything is troublesome with linux, you can blame the fruit company. For various reasons I have the misfortune to have an iphone SE2020. It does work when plugged in via usb (thank you libimobiledevice - installed by default). I have only used it to copy photos phone to PC. There is also KDE connect, I have used it (android) but not with the iphone.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
modus-modus
Level 1
Level 1
Posts: 28
Joined: Tue Feb 13, 2024 9:24 am
Location: italy

Re: Share Folders using Samba in Home Network with Mint 21

Post by modus-modus »

Yes, I tried KDEconnect and it works. But I preferred to avoid using apps to exchange files. The strange thing is that within the disk decipher app (which is found on the iPhone anyway) the files are correctly transferred with Samba to the PC while from the iPhone file app they are not
Lenovo ideapad i5 8gb ram linux Mint 21.3 Cinnamon
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Share Folders using Samba in Home Network with Mint 21

Post by altair4 »

modus-modus wrote: Thu Feb 22, 2024 4:33 pm The exchange of files from PC to iPhone works but from iPhone to PC the file is copied with a size of 0 bytes and the message of file name too long or with invalid characters appears, in reality even when copying a doc.pdf file from the same error even if there are no special characters.
If you add the following line to the [global] section of smb.conf - right under the workgroup = WORKGROUP line for example - does it fix this issue:

Code: Select all

vfs objects = catia fruit streams_xattr
Remember to restart samba:

Code: Select all

sudo service smbd restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
modus-modus
Level 1
Level 1
Posts: 28
Joined: Tue Feb 13, 2024 9:24 am
Location: italy

Re: Share Folders using Samba in Home Network with Mint 21

Post by modus-modus »

Perfect, thank you very much. Everything works perfectly
Lenovo ideapad i5 8gb ram linux Mint 21.3 Cinnamon
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Share Folders using Samba in Home Network with Mint 21

Post by AndyMH »

altair4 could you explain to us mere mortals what that line in smb.conf is doing, thanks.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Share Folders using Samba in Home Network with Mint 21

Post by altair4 »

In this particular situation with samba I'm part of the unwashed masses I'm afraid.

I could give you my interpretation of what it does or point you to the man pages but there is a sometimes member of this forum that would only correct me since I think he wrote most of the documentation for samba: RowlandP
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Share Folders using Samba in Home Network with Mint 21

Post by AndyMH »

altair4 wrote: Fri Feb 23, 2024 5:33 pm since I think he wrote most of the documentation for samba
I thought he was good, now I know why :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
LPH_[retired]
Level 2
Level 2
Posts: 80
Joined: Wed Dec 16, 2020 12:06 pm
Location: 3rd Rock
Contact:

Re: Share Folders using Samba in Home Network with Mint 21

Post by LPH_[retired] »

@altair4

I've been negligent about responding to your tutorial.
Even though I know/knew how to do this I usually had to wander around the web for bits and pieces to accomplish what I wanted. Your tutorial is comprehensive and concise and covers the basics and the potential pitfalls.

Thank you!

regards
Alcohol is gods apology for making us self aware.
James May
Post Reply

Return to “Tutorials”