3

I freshly installed Debian 8 (Jessie) on a virtual machine. I installed the Samba 4.1.17 server with the intention to have shared folders on my network. I didn't change anything to the configuration, except that the following lines have been added to the end of the /etc/samba/smb.conf file:

[public]
comment = HTTPD public directory
read only = no
locking = no
path = /var/www
guest ok = no

I added my users with smbpasswd and made sure the users have 777 priviliges on the /var/www directory.

I can list the shares with smbclient -L \\\\debian64-plankje from both localhost as remotely from my old Debian 7 VM. (debian64-plankje is the hostname of the server)

If I set guest ok = yes then I can anonymously connect to the share with smbclient \\\\debian64-public\\public, but with guest ok = no set I get the error tree connect failed: NT_STATUS_ACCESS_DENIED.

An extensive Google search didn't give me any hints to resolve this issue which I have trying to resolve for the last few hours. Just like with my old server I used the default configuration to which I only added above mentioned lined.

Below are the contents of my smb.conf file, hopefully you can help me figure out why I get the NT_STATUS_ACCESS_DENIED error.

[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

[homes]
comment = Home Directories
browseable = no
read only = yes
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

[public]
comment = HTTPD public directory
read only = no
locking = no
path = /var/www
guest ok = no
1
  • You can increase the log level to 3 and check the log. How do you specify user name and password when connecting? Have you tried WORKGROUP\user?
    – Zrin
    Jul 19, 2015 at 21:52

1 Answer 1

1

After checking the output of smbtree -d3, the following line caught my attention: resolve_lmhosts: Attempting lmhosts lookup for name DEBIAN64-PLANKJ<0x20>. It turns out that because my hostname is parsed as a NETBIOS name, I am bound to a limit of 15 characters. My original hostname debian64-plankje was 16. This resulted in some unexpected behavior of the Samba server where anonymous connects do succeed, but connects with credentials required don't.

Renaming the hostname of my server to deb64-plankje by editing /etc/hostname and /etc/hosts, and rebooting afterwards (to ensure the new hostname was adopted) resolved the issue for me :).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .