How to create and access a r/w samba share? (Solved)

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
bt101
Level 1
Level 1
Posts: 33
Joined: Thu Feb 14, 2013 12:30 am

How to create and access a r/w samba share? (Solved)

Post by bt101 » Sat Oct 20, 2018 1:16 am

I'm using Mint 19 XFCE and I want to share folders using SAMBA.
I've used this tutorial which is very good:
viewtopic.php?t=235248

The only problem, is that the command to share folders as read/write actually modifies the folder:

Code: Select all

net usershare add %n %f "" Everyone:F guest_ok=y && chmod 777 %f
I don't want to go around trashing the permissions on my folders. :P

Is there a way to share a folder r/w without modifying it?

Ideally I want it so anybody can r/w (security be damned) however if a person has to login, I can live with that.

When connecting with thunar, I've tried to enter credentials of a user on the machine with the share and that does not seem to work (I don;t even know what to enter for WORKGROUP). Forgive me, I've looked at Samba for years and can't wrap my head around how something so simple is so over complicated.
Last edited by bt101 on Sat Oct 20, 2018 3:39 pm, edited 1 time in total.

altair4
Level 19
Level 19
Posts: 9283
Joined: Tue Feb 03, 2009 10:27 am

Re: How to create and access a r/w samba share?

Post by altair4 » Sat Oct 20, 2018 7:11 am

bt101 wrote:
Sat Oct 20, 2018 1:16 am
The only problem, is that the command to share folders as read/write actually modifies the folder:

Code: Select all

net usershare add %n %f "" Everyone:F guest_ok=y && chmod 777 %f
I don't want to go around trashing the permissions on my folders. :P
Given the constraints of a samba usershare modifying the shared folder permissions is the only way to allow guest write access to a folder.
Is there a way to share a folder r/w without modifying it?
[1] Remove the && chmod 777 %f part of the command and make sure you have force user = your-user-name in the [global] section of smb.conf.

OR:
[2] Don't use a samba usershare. Use a classic share definition in /etc/samba/smb.conf. Something like this:

Code: Select all

[Public]
path = /home/altair/Public
read only = no
guest ok = yes
force user = altair
You will have to restart smbd when you edit smb.conf: sudo service smbd restart
When connecting with thunar, I've tried to enter credentials of a user on the machine with the share and that does not seem to work (I don;t even know what to enter for WORKGROUP).
What operating system contains the share you are trying to access. If it is another Linux Samba server you will need to pass it a user name that exists on that server and his samba password. You create the samba password this way:

Code: Select all

sudo smbpasswd -a altair
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

bt101
Level 1
Level 1
Posts: 33
Joined: Thu Feb 14, 2013 12:30 am

Re: How to create and access a r/w samba share? (Solved)

Post by bt101 » Sat Oct 20, 2018 2:03 pm

altair4 wrote:
Sat Oct 20, 2018 7:11 am
....

Code: Select all

sudo smbpasswd -a altair
Thanks, nice reply. You both explained it and specified the exact steps (which simplifies the mind boggling world of samba :? ).
I'll use one of those options and mark as solved.

It's funny, I would have thought that sharing files would be one of the top things that people need to do with a computer (before using email, web browsers, spreadsheets, or any of that other nice stuff). On the surface, it would seem that sharing files would also be the simplest thing to do:
  • local users already exist
  • local users already have passwords
  • local users already have access right to files and folders
It would seem that there should be only 2 configuration items for a share:
  1. the folder to share
  2. the user that needs access
Ok I'm over-simplifying a bit (you may want to share to multiple users or a group). However actual samba seems to be exceedingly over-complicated for such a simple process (there's a gazillion config items that boggle the mind).

I can't imagine most people trying to figure out the options, editing a config file, creating a new set of passwords for users when they already have passwords, restarting a service, etc, etc. Thank heaven for help in forums. :)

Post Reply

Return to “Newbie Questions”