smb.conf for Mint 14 [SOLVED]

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

smb.conf for Mint 14 [SOLVED]

Post by turboscrew » Tue Apr 23, 2013 3:25 pm

Can someone direct me to some way of configuring samba for Mint 14 such that
anyone that can access my home netrork can access my disk share and use printer (on that Mint machine)?

Preferably without passwords.

It seems that some configuration tools are not doing a good job:
GADMIN-SAMBA doesn't get the shares to be shared, and system-config-samba doesn't start - only asks for the password and disappears.

Oops, I forgot to mention.
The share is old NTFS partition with about 60 Gigs of stuff.
Last edited by turboscrew on Sun Apr 28, 2013 11:05 am, edited 1 time in total.

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

Re: smb.conf for Mint 14

Post by altair4 » Tue Apr 23, 2013 4:14 pm

You've got a lot going on there.
... and system-config-samba doesn't start - only asks for the password and disappears.
Mint doesn't have that package installed by default so you need to add it:

Code: Select all

sudo apt-get install system-config-samba
It will show up in the Cinnamon menu after you logout/in again. If it still just disappears I don't have an answer for that except gadmin-samba of course.

Speaking of gadmin-samba. I won't touch any system where that has been used because it makes a mess of of smb.conf. Like an unable to troubleshoot kind of mess. I recommend removing gadmin-samba and starting over with a fresh ( almost default ) smb.conf:
altair4 wrote:(1) Make sure the following file exists:
/usr/share/samba/smb.conf
(2) Make a backup of your current smb.conf

Code: Select all

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
(3) Copy the default:

Code: Select all

sudo cp -a /usr/share/samba/smb.conf /etc/samba/
(4) Correct one mistake in the new one:
Find the line:
encrypt passwords = false
Could also be listed as "no"

and change it to:

Code: Select all

encrypt passwords = true
(5) Restart samba

Code: Select all

sudo service smbd restart
Oops, I forgot to mention.
The share is old NTFS partition with about 60 Gigs of stuff.
That may be an issue depending on how you are mounting it. If you are mounting it through Nemo then it will mount to: /media/your-user-name/LABEL. The only user that will gain access to that share is "your-user-name" regardless of how you set up the share in smb.conf. One way out of this is to force the remote user to look like you for that share. You would do that by adding the following line in the appropriate place:

Code: Select all

force user = your-user-name
If you have shares defines in smb.conf then place the line within the share definition. And then restart smbd.

Note: It's normally here that I suggest posting the output of this command: testparm -s. But if you are still using gadmin-samba frankly I don't want to see it since it will look like the Sunday paper after the dog barfed all over it.

Note2: This won't work after gadmin-samba does it's magic but the easiest way to have done this was to open Nemo, browsed to the folder you want to share, select "Sharing Options" and mark all the boxes. For the ntfs folder you would still have to do the "force user" thing but placed the line right under the workgroup line towards the beginning of smb.conf
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

Re: smb.conf for Mint 14

Post by turboscrew » Thu Apr 25, 2013 6:04 pm

I installed system-config-samba.
I started it from menu.

I'm not using Cinnamon, MATE. ;-D

I already copied the original smb.conf to be safe.

Maybe it's that Nemo-mount.
So, I need to make my user name a samba user too and add the "force user"?

How do I remove Nemo-mount?
It might be better to use conventional mount via fstab?

BTW, I tried to ask about the tools, but didn't get any answers back then.
When I was using puppy and tried to configure samba TNG, I was threatened by almost lethal injection if I messed up the smb.conf with SWAT. :-)

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

Re: smb.conf for Mint 14

Post by altair4 » Fri Apr 26, 2013 6:40 am

If you are using system-config-samba it will produce a share definition that looks something like this:
[NTFS]
path = /media/altair/NTFS
writeable = yes
; browseable = yes
guest ok = yes
You need to change the share definition to this:
[NTFS]
path = /media/altair/NTFS
writeable = yes
; browseable = yes
force user = altair
guest ok = yes
You do not need to make "altair" a samba user. "force user" refers to the local Linux login user not the samba user.
Then 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.

User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

Re: smb.conf for Mint 14

Post by turboscrew » Fri Apr 26, 2013 2:11 pm

Thanks.
I'll try it as soon as I can. (I'm not sure about this week end).

User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

Re: smb.conf for Mint 14

Post by turboscrew » Fri Apr 26, 2013 2:26 pm

I removed system-config-samba and installed it again.
Tried to start it in control center, and again - it asks for password.
When I give it and press enter, it disappears.

It doesn't seem to work with Mint 14 + MATE.
Any ideas which log I could peek in to see ẃhat's wrong?

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

Re: smb.conf for Mint 14

Post by altair4 » Fri Apr 26, 2013 3:22 pm

I'm running MATE 14 and it runs without issues.

Run the following command in a terminal and see what it's problem is:

Code: Select all

gksu system-config-samba
But you have to edit smb.conf anyway so just add the share definiton directly:

Code: Select all

gksu pluma /etc/samba/smb.conf
Don't forget to restart samba when you are done:

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.

User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

Re: smb.conf for Mint 14

Post by turboscrew » Fri Apr 26, 2013 6:03 pm

OK, here we go:

Code: Select all

$ gksu system-config-samba
  File "/usr/sbin/system-config-samba", line 45, in <module>
    mainWindow.MainWindow(debug_flag)
  File "/usr/share/system-config-samba/mainWindow.py", line 116, in __init__
    self.samba_user_da$ gksu system-config-samba
  File "/usr/sbin/system-config-samba", line 45, in <module>
    mainWindow.MainWindow(debug_flag)
  File "/usr/share/system-config-samba/mainWindow.py", line 116, in __init__
    self.samba_user_data = sambaUserData.SambaUserData(self)
  File "/usr/share/system-config-samba/sambaUserData.py", line 46, in __init__
    self.readSmbPasswords()
  File "/usr/share/system-config-samba/sambaUserData.py", line 63, in readSmbPasswords
    raise RuntimeError, (_("You do not have permission to execute %s." % pdbeditcmd))
RuntimeError: You do not have permission to execute /usr/bin/pdbedit.ta = sambaUserData.SambaUserData(self)
  File "/usr/share/system-config-samba/sambaUserData.py", line 46, in __init__
    self.readSmbPasswords()
  File "/usr/share/system-config-samba/sambaUserData.py", line 63, in readSmbPasswords
    raise RuntimeError, (_("You do not have permission to execute %s." % pdbeditcmd))
RuntimeError: You do not have permission to execute /usr/bin/pdbedit.
There is no smb.conf at the moment (renamed it).
I installed system-config-samba from the synaptic.

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

Re: smb.conf for Mint 14

Post by altair4 » Sat Apr 27, 2013 7:20 am

There is no smb.conf at the moment (renamed it).
Then what do you expect system-config-samba to do, create one?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
turboscrew
Level 4
Level 4
Posts: 214
Joined: Sat Sep 26, 2009 2:13 pm

Re: smb.conf for Mint 14

Post by turboscrew » Sun Apr 28, 2013 5:30 am

altair4 wrote:
There is no smb.conf at the moment (renamed it).
Then what do you expect system-config-samba to do, create one?
Erm... yes - like gadmin-samba did.

Anyway, I copied my older try of smb.conf.old as smb.conf, startes system-config-samba, and it started.
(Before re-installing I tries also with smb.config, but it didn't start.)

Re-installing obviously fixed system-config-samba.)

With system-config-samba I re-browsed the disk to be shared, and then edited the "force user" in the smb.conf.
Restarted smbd (and nmbd just to be sure) and IT WORKED! THANKS!

Post Reply

Return to “Other networking topics”