1

I used to use raspbian 7 before recently making a switch to a debian 8 image provided by this link https://www.collabora.com/about-us/blog/2015/02/03/debian-jessie-on-raspberry-pi-2/

While on raspbian i was able to run samba 3.6 smoothly. But when i switch to debian 8 that came with samba 4.1 things broke. I have added a user 'pi' to smbpasswd. This is the result i get when trying to connect via smbclient:

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.17-Debian] tree connect failed: NT_STATUS_ACCESS_DENIED

testparm output is as follows:

root@jessie-rpi:~# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[Media0]"
Processing section "[Media1]"
Processing section "[Files]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
    netbios name = %H
    server string = jessie-rpi
    passdb backend = smbpasswd
    syslog = 2
    syslog only = Yes
    enable core files = No
    smb ports = 445
    server max protocol = SMB2
    min receivefile size = 16384
    name resolve order = lmhosts, wins, bcast, host
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
    load printers = No
    printcap name = /dev/null
    preferred master = Auto
    idmap config * : backend = tdb
    read only = No
    smb encrypt = No
    use sendfile = Yes
    mangled names = No

[Media0]
    comment = Media HDD0
    path = /media/media0
    valid users = @users
    force group = users
    create mask = 0770
    directory mask = 0770

[Media1]
    comment = Media HDD1
    path = /media/media1
    valid users = @users
    force group = users
    create mask = 0770
    directory mask = 0770

[Files]
    comment = Misc Files
    path = /media/files
    valid users = @users
    force group = users
    create mask = 0770
    directory mask = 0770

smb.conf

[global]
  server string = jessie-rpi
  workgroup = WORKGROUP
  netbios name = %h
  security = user
  #guest account = root
  socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
  smb ports = 445
  max protocol = SMB2
  min receivefile size = 16384
  deadtime = 30
  os level = 20
  mangled names = no
  syslog only = yes
  syslog = 2
  name resolve order = lmhosts wins bcast host
  preferred master = auto
  domain master = auto
  local master = yes
  printcap name = /dev/null
  load printers = no
  browseable = yes
  writeable = yes
  printable = no
  encrypt passwords = true
  enable core files = no
   passdb backend = smbpasswd
  smb encrypt = disabled
  use sendfile = yes


# Using the following configurations as a template allows you to add
# writable shares of disks and paths under /storage

[Media0]
comment = Media HDD0
path = /media/media0
valid users = @users
force group = users
create mask = 0770
directory mask = 0770
read only = no

[Media1]
comment = Media HDD1
path = /media/media1        
valid users = @users
force group = users
create mask = 0770
directory mask = 0770
read only = no

[Files]
comment = Misc Files
path = /media/files        
valid users = @users
force group = users
create mask = 0770
directory mask = 0770
read only = no

Thanks in advance!

1

First guess

You did not say, so I'm going to ask and tell you how to do it. Did you create SMB accounts (for each of the users in the group users) and did you connect using such an account?

In Samba when using the smbpasswd backend, you need to create a corresponding account in samba itself. Let's assume you have the user foo in the group users on your RPi, then you want to run:

smbpasswd -a foo

You can use the same password for the smbpasswd backend as you use for the RPi login of foo. Or you can use a different one. It's your choice.

Now using smbclient, you just need to make sure you add -U foo (or whatever username you chose) and enter the password.

Repeated environment

So on my Raspberry Pi 2 which is running Raspbian (but upgraded to the Jessie baseline) I have install samba (sudo apt-get install samba version 4.1.17+dfsg-2) from Debian main repositories.

I've copy/paste your configuration (so replaced my entire /etc/samba/smb.conf with the one you provided) but only set-up "media0" and changed the path to an existing directory on my RPi. I have added the user pi to the smbpasswd (sudo smbpasswd -a pi) and I made sure that the path to media0 is writable to the user pi (to verify that try to do on your RPi: touch /media/media0/huygens-test if it created an empty file, it works).

And I started the smbd daemon (sudo systemctl start smbd).

On my laptop, I used both smbclient and Nautilus to connect to the RPi samba share successfully. So your samba configuration file is good!

What can be the problems:

  1. The path to the shared directory are incorrect or are not accessible by the user pi;
  2. A network problem, maybe you have another computer competing for the group WORKGROUP. Try to change the workgroup name and restart smbd.
  3. Check your firewall(s)? Do you have any in between the test client and the RPi (including on both end)?
  4. Maybe a problem with nmbd? is this daemon running (ps waux | grep nmbd)? Does it work better if you stop it?
  5. Is samba really running? Check both: ps waux | grep smbd and also sudo netstat -tulpen | grep smbd
  • Oh yes I have added a user 'pi' using that and the user also shows up when I type pdedit -L, so I don't think it's an authentication issue – Frank Morris Aug 30 '15 at 19:26
  • What are the logs saying on the server? Something like: sudo journalctl just after you try smbclient. Or just look under /var/log/samba/ for clues. What does it say there? – Huygens Aug 30 '15 at 19:29
  • I just looked through all the different types of logs in /var/samba/ and i nothing shows up. This is what i found in the syslog Aug 30 12:50:51 jessie-rpi systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)... Aug 30 12:50:52 jessie-rpi smbd[249]: Starting SMB/CIFS daemon: smbd. Aug 30 12:50:52 jessie-rpi systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd). Aug 30 12:50:52 jessie-rpi smbd[261]: [2015/08/30 12:50:52.735530, 0] ../lib/util/become_daemon.c:136(daemon_ready) – Frank Morris Aug 30 '15 at 19:46
  • I will try it on my RPi tomorrow. See if I have the same trouble. – Huygens Aug 30 '15 at 19:49
  • Hi Frank, I'm going to edit my response... – Huygens Aug 31 '15 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.