pleriche
Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

Samba problem on Jessie

Thu May 12, 2016 9:43 pm

I had Samba working fine on Wheezy and tried to set it up the same on Jessie. I had security = user in smb.conf on Wheezy, and that now seems to have been replaced by server role = standalone server, but otherwise I changed nothing except to insert an identical [homes] section as I had on Wheezy.

smbclient shows no shares being offered in contrast to showing pi as a share on Wheezy, and all attempts to connect from Windows give Access Denied. Can anyone suggest what's wrong please?

Regards - Philip

User avatar
kolban
Posts: 143
Joined: Fri Dec 04, 2015 1:45 am
Location: Texas, USA

Re: Samba problem on Jessie

Fri May 13, 2016 12:34 am

Would it be possible for you to post your smb.conf file and I'll compare it to my working versions?
FREE book on Raspberry Pi usage and programming

https://leanpub.com/pi

pleriche
Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

Re: Samba problem on Jessie

Fri May 13, 2016 8:51 am

I fixed it by typing
smbpasswd -a pi
and entering a password.

I don't remember having to do this on Wheezy (and an older version of Samba I think), or if I did I twice failed to document it in my notes, and it doesn't seem to appear in the samba setup guides I looked at.

Anyway, for reference here's my smb.conf (with comment and blank lines grepped out):

Code: Select all

[global]
   workgroup = WORKGROUP
   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
   passdb backend = tdbsam
   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
[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

pcmanbob
Posts: 9287
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Samba problem on Jessie

Fri May 13, 2016 10:14 am

Just for reference security = user and server role = standalone server are 2 totally separate settings.

server role tells the samba server what role its playing on the network there are a number of options

standalone | standalone server
This one can run by itself or it can join and participate a Windows Domain. This option also can be used with map to guest to create an open file and print server.

member | member server
This one must be joined into an existing Windows Domain (which could also be Samba3 or Samba4 based). Need to have the encrypted passwords = yes, can map with Winbind.

classic primary domain controller
Run Samba4 like it's a NT4/Samba3 Domain Controller.

netbios backup domain controller
Runs a classic Samba backup domain controller, providing domain logon services to Windows and Samba clients of an NT4-like domain. Useful for a redundant logon service.

active directory domain controller | domain controller | dc
The big-daddy, Active Directory Domain Controller providing logon services for WindowsXP through Windows8.

security = user sets the security access level , with it set as user samba checks you user/password only once when you log on from then on you can access any share without having to re-enter you user/password.

so you should have both settings present in you smb.conf
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

pleriche
Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

Re: Samba problem on Jessie

Fri May 13, 2016 11:14 am

Thank you, that's interesting and makes sense. But what doesn't make sense then is why the given smb.conf doesn't contain a security parameter at all, even commented out!

However, I tried removing (with pdbedit) the Pi user entry which I'd added, adding security = user to smb.conf and rebooting, and it stopped working, so that can't be the whole story.

pcmanbob
Posts: 9287
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Samba problem on Jessie

Fri May 13, 2016 11:37 am

However the security is set you still need a user and a password to log on .

you said you had added the user pi to the samba password database which is why it was working , by removing the user pi from the password database you now have no users that can access the samba, hence it does not work.

As to why the is no security setting in the example smb.conf your guess is as good as mine, its only an example it does not list every option, I have a book yes an actual printed book for samba 2 and the are over 40 A5 double side pages listing smb.conf entry options with just a 4 line explanation for each so it gives you an idea of how many there are.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

pleriche
Posts: 90
Joined: Mon Oct 14, 2013 8:44 am

Re: Samba problem on Jessie

Fri May 13, 2016 9:00 pm

OK, so (for the benefit of anyone sent here in the future by Mr Google), according to the smb.conf man page the server role parameter defaults to auto if not given, which causes Samba to determine the server role from the security setting. And the security setting defaults to user if not given, this being the commonest.

So you can define the type of server either by setting server role or by setting the security parameter. Evidently the Powers that Be decided it was better to define a samba server by role than by function.

In my notes from last time I did this it seems I omitted to record that you gave to set up a samba user account with the command (under root):
smbpasswd -a pi

rokeno
Posts: 1
Joined: Sun May 29, 2016 12:53 pm

Re: Samba problem on Jessie

Sun May 29, 2016 12:56 pm

smbpasswd -a pi - This worked for me.
Remember that you should add sudo if by any chance you try this command as pi

Also, what doesn't say here is that you need to edit that conf with this info
#this is to add folders when shared (in my case HDD volumes i have mounted under /media/)
[Backup]
comment = Backup Folder
path = /media/USBHDD1/shares
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

Note: Whatever you put in the brackets in the top line is going to be the name of the folder as it appears on the network share. If you want another name other than “Backup” now is the time to edit it.

Press CTRL+X to exit, press Y when asked if you want to keep changes and overwrite the existing configuration file. When back at the command prompt enter the following command to restart the Samba daemons:

sudo /etc/init.d/samba restart



the guide is here: http://www.howtogeek.com/139433/how-to- ... ge-device/

Return to “Troubleshooting”