[SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
RobertX
Level 4
Level 4
Posts: 261
Joined: Thu Apr 12, 2012 6:09 pm

[SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by RobertX »

Hi,

I've downloaded LM18 Cinnamon and cannot find the tool that LM17.X has with joining a network and sharing files (i.e. "Shared Folders").

Is there an alternative to share my files to Windows computers without editing a configuration file such as smb.conf?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sikejsudjek

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by sikejsudjek »

If you just want to browse windows shares on windows pc's you don't need samba. In the file manager (nemo) click file, connect to server, insert the ip address and it should connect. You can then bookmark that address, click rename and name it as your windows pc and it will show up in nemo each time.

If you want to share files from your linux mint pc (or a printer connected to the mint pc), you will need to install samba from the software manager. Do not install the samba gui/gadmin samba tools or they will mess it up ! At the moment sharing with samba without passwords is messed up. I had to create a user on my windows workgroup with user smbuser password smbpassword. I then gave this windows user access to the printer and files on the windows pc. Then it connected !

Your windows workgroup should be WORKGROUP and homegroup sharing should be off.

Best of luck - I spent two days getting this working and I can't remember exactly all the steps I took to get it set up. I think I changed the samba config file to allow guests and guest browsing as well.

Hopefully the above will help. I'm no expert on samba, so someone else will no doubt chip in better advice ! I have now managed to share a printer on a linux mint pc to windows boxes and have got a windows connected printer to work from linux mint, plus all file sharing is working in a mixed network of mint, windows 7 and windows 10. So it is possible - just a PITA to set up......
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

First, you need to install samba since the server component is not installed by default in Mint 18.

Code: Select all

sudo apt install samba --install-recommends
Once that is done there are several ways to create shares in Mint18 Cinnamon:

*** Through nemo the file manager:
Nemo > Right click a folder you own > Sharing Options

*** You can use system-config-samba but first you will need to install it:

Code: Select all

sudo apt install system-config-samba
And then you will need to fix a bug by creating an empty file:

Code: Select all

sudo touch /etc/libuser.conf
Please note that system-config-samba is very old reflecting options that were present in versions 2 and 3 of Samba which if enabled will prevent samba from running in the current Version 4. If you only use it to create shares without changing any of the server components you should be fine.

*** As far as "Shared Folders" is concerned you've got a bit of work to do.

You need to install a package:

Code: Select all

sudo apt install gnome-system-tools 
Then you need to change the launcher so that it shows up in the Menu:

Code: Select all

gksu xed /usr/share/applications/shares.desktop
And change "NoDisplay" from true to false
[Desktop Entry]
...
...
NoDisplay=false
X-Ubuntu-Gettext-Domain=gnome-system-tools
Then it will show up under: Menu > Administration > Shared Folders.

*** Finally, you should go through the check-list just to make sure everything is set up correctly: Samba Browsing Problems Checklist
Last edited by altair4 on Fri Jul 29, 2016 6:56 am, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by all41 »

altair4 wrote:First, you need to install samba since the server component is not installed by default in Mint 18.

Code: Select all

sudo apt install samba --install-recommends
Once that is done there are several ways to create shares in Mint18 Cinnamon:

*** Through nemo the file manager:
Nemo > Right click a folder you own > Sharing Options

*** You can use system-config-samba but first you will need to install it:

Code: Select all

sudo apt install system-config-samba
And then you will need to fix a bug by creating an empty file:

Code: Select all

sudo touch /etc/libuser.conf
Please note that system-config-samba is very old reflecting options that were present in versions 2 and 3 of Samba which when enabled will prevent samba from running in the current Version 4. If you only use it to create shares without changing any of the server components you should be fine.

*** As far as "Shared Folders" is concerned you've got a bit of work to do.

You need to install a package:

Code: Select all

sudo apt install gnome-system-tools 
Then you need to change the launcher so that it shows up in the Menu:

Code: Select all

gksu xed /usr/share/applications/shares.desktop
And change "NoDisplay" from true to false
[Desktop Entry]
...
...
NoDisplay=false
X-Ubuntu-Gettext-Domain=gnome-system-tools
Then it will show up under: Menu > Administration > Shared Folders.

*** Finally, you should go through the check-list just to make sure everything is set up correctly: Samba Browsing Problems Checklist

Is it mostly the same drill for LM18 Mate to use caja-share?
Everything in life was difficult before it became easy.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

Is it mostly the same drill for LM18 Mate to use caja-share?
It's an extra step for MATE since for some reason caja-share isn't installed by default in either Mint or Ubuntu-MATE.

If you only create shares through caja you don't need system-config-samba or gnome-system-tools. You don't need them in Cinnamon either if you only use Nemo.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by all41 »

The Mint 18 machine returns error 255 when sharing a folder:
caja share error.png
It's all Mint network and all the 17x machines have the samba.services file in the etc/avahi/services directory
Do I need something different for 18?

Edit: I see that I have redirected the focus of the OP's thread--my apologies RobertX
Everything in life was difficult before it became easy.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

I installed a new instance of Min18 MATE to see if I missed a step somewhere:

** Installed samba
** Installed caja-share
** logged out and logged back in again
** Shared a folder

Works for me.

The kind of error message where it can't find the /var/lib/samba/usershare folder implies that you didn't install samba first. If you have I don't have an explanation for your symptom - at the moment.

Um ... It's possible you aren't a member of the sambashare group - but that should induce a different error message:

Code: Select all

sudo gpasswd -a altair sambashare
You will have to logout and login again for the group membership to take affect.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by all41 »

@altair4
I have sharing:

sudo apt purge samba
sudo apt get install samba

Must have been a glitch in the samba package.
Checking further--the error message was correct /var/lib/samba/usershares did not exist
Thanks for everything. You're the man
Everything in life was difficult before it became easy.
RobertX
Level 4
Level 4
Posts: 261
Joined: Thu Apr 12, 2012 6:09 pm

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by RobertX »

altair4,

Thank you for the reply.

Now, if I use gnome-system-tools, do I have to use the other two tools that you mentioned?
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

No, you don't have to use any of the other tools.

But remember that if you use system-config-samba and select any of the other "Authentication Modes" other than "User" the samba server daemon will not start. The "Share" and "Server" options were deprecated long ago.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertX
Level 4
Level 4
Posts: 261
Joined: Thu Apr 12, 2012 6:09 pm

Re: How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by RobertX »

I'm going to just stick to Linux Mint MATE.

Thanks!
Banzai Beagle

Re: [SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by Banzai Beagle »

Why is this so hard? All I want to do is look at all the files on all the computers in my house.
bwestrup777
Level 1
Level 1
Posts: 17
Joined: Tue Apr 02, 2013 12:33 pm

Re: [SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by bwestrup777 »

The file sharing stuff has always been borked under mint. they should do everyone a favor and just leave it out completely and let everyone install it fresh from the repos. I don't know know what they do to it, to get it so messed up, but simply removing it would improve the distro a lot.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

bwestrup777 wrote:The file sharing stuff has always been borked under mint. they should do everyone a favor and just leave it out completely and let everyone install it fresh from the repos. I don't know know what they do to it, to get it so messed up, but simply removing it would improve the distro a lot.
This entire topic is about setting up a Samba server in Mint18. In Mint18 they followed your advice and didn't install Samba by default.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
zpangwin
Level 1
Level 1
Posts: 21
Joined: Sun Mar 04, 2018 2:21 am
Location: Southeast U.S.
Contact:

Re: [SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by zpangwin »

As far as I know system-samba-config was never updated to launch without gksu.

If that is still the case and anyone is looking for a way to use system-samba-config in a post gksu world, I have a setup script on github that makes sure the appropriate packages are installed, creates a wrapper script + policykit exception (the more modern "improved" replacement for gksu), and updates the shortcuts to use the wrapper script.

I'm using it on Mint 19.3 Cinnamon x64 and it works great for setting up network shares for me. I don't remember for sure but I've been using this for awhile and am pretty confident that it worked on Mint 18.3 as well.


In addition to system-samba-config, I also do the following steps:
  • Create one or more limited accounts on the system for samba (e.g. sudo adduser --gecos "" --no-create-home --disabled-login --shell /bin/false SAMBA_USER;)
  • Setup a system password for samba user (e.g. sudo passwd SAMBA_USER;)
  • In system-samba-config > Preferences > Samba Users > define the same samba user(s) with the same password(s) as you just did on the system.
  • Add your normal user AND the new samba user(s) to a new group (e.g. sudo groupadd SAMBA_GROUP; sudo usermod -a -G SAMBA_GROUP USER;)
  • Change the local ownership of whatever share to your regular user + the new group (e.g. sudo chown -R ${SUDO_USER:-$USER}:SAMBA_GROUP /local/path/to/my/share;)
  • Change the local perms to make the group ownership sticky (e.g. sudo find /local/path/to/my/share -type d -exec chmod g+sx "{}" \;;)
  • In system-samba-config, add a new share using whatever /local/path/to/my/share you used in the steps above, check visible, then on the access tab check the samba user(s) you created above.
  • Not sure if this is required restart service (or alternately, reboot pc): sudo systemctl restart smbd; sudo systemctl restart nmbd;
This works for me using ip address with Mint-to-Mint, Mint-toWin7, Win7-to-Mint for SMB. In Windows 7, it just shows up under Network by name with no issue. I wiped Win10 off everything I own so will have to wait for someone to visit before I can confirm but I *think* this setup worked for Win10-to-Mint also.

I also have winbind + libnss-winbind installed and I have the following in my /etc/nsswitch.conf:

Code: Select all

passwd:         compat systemd
group:          compat systemd
shadow:         compat
gshadow:        files

hosts:          files dns wins mdns4_minimal [NOTFOUND=return]
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

and the global section of my /etc/samba/smb.conf looks like this:

Code: Select all

[global]
	name resolve order = bcast host lmhosts wins
	workgroup = WORKGROUP
	client max protocol = NT1
	server string = %h server (Samba, Ubuntu)
	dns proxy = no
	log file = /var/log/samba/log.%m
	max log size = 1000
	syslog = 0
	panic action = /usr/share/samba/panic-action %d
	server role = standalone server
	obey pam restrictions = yes
	unix password sync = yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	pam password change = yes
	map to guest = bad user
	usershare allow guests = yes
	username map = /etc/samba/smbusers
	security = user
p.s. - Oh and in case any one is wondering "why not just share in nemo / caja" ? Well, I like being able to view all of my shares in one place from a GUI without cluttering up Nemo. When I open Menu > Admin > Shared Folders, I have gotten an error (since at least Mint 19.1) about needing to install "either Samba or NFS" despite Samba already being installed and shares defined via system-samba-config working great. If the Nemo/Caja route works for you and you like it, then more power to you but it does not work for me so I use what does. :D That said, if you see any improvements to be made to my config (especially security-related) then by all means, please let me know.

to use my setup script:

Code: Select all

git clone https://github.com/zpangwin/linux-setup-scripts.git;
find linux-setup-scripts -type f -iname '*.sh' -exec chmod a+rx "{}" \;;
cd linux-setup-scripts/mint-19.3/apps/samba-config
./install-scripts-with-policykit-exception.sh
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] How do I network SAMBA style using Linux Mint 18 (Sarah)

Post by altair4 »

More of an FYI but ... from a quote at git:
Unfortunately, it stopped working after gksu was deprecated and I never saw an update that moved things to policykit.
You never saw an update that migrated system-config-samba to policykit because system-config-samba no longer exists: Please remove system-config-samba from Ubuntu

Doesn't affect Mint18/19 but it will affect Mint20
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Networking”