Ubuntu – Why are the Macs failing to authenticate to the SAMBA file sharing server

file-sharingmac-osxsambaUbuntu

I have recently set up a SAMBA file share. After going through a series of steps, I have finally been able to have most of my computers see this server. The primary requirements were: 1) it had to be password protected, 2) have multiple users, 3) each user can own a file, but all users can write to each others' files.

I am in an office with 5 Macs, 1 Linux Server (Ubuntu 13.04), 1 Windows Server (Windows 2008 R2), and three Windows XP Pro desktops. All computers can access the share properly, except the Macs.

Oddly enough, ONE Mac is able to view the share and login. All the other Macs fail to login after putting in the username and password.

Here are the contents of my smb.conf file:

[global]

    workgroup = workgroup
    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
    security = user
    encrypt passwords = yes
    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
    guest ok = no
    guest account = nobody
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0775
   directory mask = 0775



[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



[interactive]
    path = /home/shok07a/interactive
    writeable = yes
    browseable = yes
    comment = interactive
    create mask = 0777
    directory mask = 2777
    force directory mode = 2777
    guest ok = no
    force group = sambashare

Logs:

start log.nmbd:

[2013/08/26 08:51:27.730313,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:51:27.730464,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:51:27.730526,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 08:53:02.002178,  0] nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server SHOK07A-INTERACTIVE-SERVER is now a local master browser for workgroup WORKGROUP on subnet 10.42.0.1

  *****
[2013/08/26 16:45:47.916574,  0] libsmb/nmblib.c:856(send_udp)
  Packet send failed to 10.42.0.255(138) ERRNO=Invalid argument
[2013/08/26 16:45:47.916689,  0] libsmb/nmblib.c:856(send_udp)
  Packet send failed to 10.42.0.255(138) ERRNO=Invalid argument
[2013/08/26 16:58:56.608481,  0] nmbd/nmbd_incomingdgrams.c:311(process_local_master_announce)
  process_local_master_announce: Server SHOK09A-PC at IP 10.42.0.92 is announcing itself as a local master browser for workgroup WORKGROUP and we think we are master. Forcing election.
[2013/08/26 16:58:56.608685,  0] nmbd/nmbd_become_lmb.c:150(unbecome_local_master_success)
  *****

  Samba name server SHOK07A-INTERACTIVE-SERVER has stopped being a local master browser for workgroup WORKGROUP on subnet 192.168.1.35

  *****
[2013/08/26 16:58:56.609163,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:58:56.609241,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:58:56.609334,  0] nmbd/nmbd_nameregister.c:492(register_name)
  register_name: NetBIOS name SHOK07A-INTERACTIVE-SERVER is too long. Truncating to SHOK07A-INTERAC
[2013/08/26 16:59:13.629340,  0] nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****

  Samba name server SHOK07A-INTERACTIVE-SERVER is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.35

  *****

end log.nmbd

None of the other logs showed anything. They were empty. I saved them anyway, cleared logs, and attempted to connect again. Again nothing showed up in my logs.

I pinged the machine from the Mac and all pings go through just fine. I am prompted to enter the user name and password.

So it seems the machines can 'see' each other, but auth is failing.

EDIT (more logs):

[2013/08/27 09:28:29.864230,  2] smbd/reply.c:553(reply_special)
  netbios connect: name1=192.168.1.35   0x20 name2=STATION-4      0x0
[2013/08/27 09:28:29.864427,  2] smbd/reply.c:573(reply_special)
  netbios connect: local=192.168.1.35 remote=station-4, name type = 0
[2013/08/27 09:34:29.843796,  2] smbd/reply.c:553(reply_special)
  netbios connect: name1=192.168.1.35   0x20 name2=STATION-4      0x0
[2013/08/27 09:34:29.844328,  2] smbd/reply.c:573(reply_special)
  netbios connect: local=192.168.1.35 remote=station-4, name type = 0
[2013/08/27 09:40:29.850174,  2] smbd/reply.c:553(reply_special)
  netbios connect: name1=192.168.1.35   0x20 name2=STATION-4      0x0
[2013/08/27 09:40:29.850389,  2] smbd/reply.c:573(reply_special)
  netbios connect: local=192.168.1.35 remote=station-4, name type = 0

Station 4 is one of the Macs that cannot connect.

Begin log.smbd

[2013/08/27 09:25:40,  0] smbd/server.c:1026(main)
  smbd version 3.6.9 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2013/08/27 09:25:40,  2] lib/tallocmsg.c:124(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2013/08/27 09:25:40,  2] lib/dmallocmsg.c:78(register_dmalloc_msgs)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2013/08/27 09:25:40.140866,  2] param/loadparm.c:4985(max_open_files)
  rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
[2013/08/27 09:25:40.141089,  2] param/loadparm.c:8327(do_section)
  Processing section "[printers]"
[2013/08/27 09:25:40.141181,  2] param/loadparm.c:8327(do_section)
  Processing section "[print$]"
[2013/08/27 09:25:40.141246,  2] param/loadparm.c:8327(do_section)
  Processing section "[interactive]"
[2013/08/27 09:25:40.141494,  2] lib/interface.c:341(add_interface)
  added interface wlan0 ip=fe80::6a94:23ff:feb3:3a9b%wlan0 bcast=fe80::ffff:ffff:ffff:ffff%wlan0 netmask=ffff:ffff:ffff:ffff::
[2013/08/27 09:25:40.141605,  2] lib/interface.c:341(add_interface)
  added interface eth0 ip=fe80::7a45:c4ff:fe06:2876%eth0 bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
[2013/08/27 09:25:40.141655,  2] lib/interface.c:341(add_interface)
  added interface wlan0 ip=192.168.1.35 bcast=192.168.1.255 netmask=255.255.255.0
[2013/08/27 09:25:40.141688,  2] lib/interface.c:341(add_interface)
  added interface eth0 ip=10.42.0.1 bcast=10.42.0.255 netmask=255.255.255.0
[2013/08/27 09:25:40.141783,  0] smbd/server.c:1082(main)
  standard input is not a socket, assuming -D option
[2013/08/27 09:25:40.147336,  2] smbd/server.c:815(smbd_parent_loop)
  waiting for connections
[2013/08/27 09:25:40.151155,  2] rpc_client/cli_winreg_spoolss.c:896(winreg_create_printer)
  winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Officejet_7500_E910__4C53E0_ already exists
[2013/08/27 09:25:40.151234,  2] smbd/server.c:301(remove_child_pid)
  Could not find child 25727 -- ignoring

End log.smbd

EDIT Here is the MOST relative log:

2013/08/27 10:37:45.149211,  2] auth/auth.c:319(check_ntlm_password)
  check_ntlm_password:  Authentication for user [shok10a] -> [shok10a] FAILED with error NT_STATUS_WRONG_PASSWORD

The password is NOT wrong, however.

Best Answer

It seems as though no one can answer this question. After some thorough reading, it appears as though the issue most likely has to do with how OS X authenticates passwords with SAMBA (LM, NTLM, NTLMV2).

As some Macs were able to connect and others not, I decided to simply install Netatalk and use the AFP protocol for all of the Macs.

While this makes it a bit more troublesome to administrate since I have to worry about the settings of two file sharing systems, it seems to be working fine. Ideally, it would have been better to simply use SAMBA, but all sources I read said that it would be required that I run specific scripts on the Mac machines to allow them to pass the passwords in plain text (which, by default, is disabled).

So there you have it: if you are having this problem, please look up a tutorial about setting up Netatalk. It will probably be a bit faster than SAMBA on the Mac side, anyway.

UPDATE: This was an issue for Snow Leopard. Newer versions of OS X (Mavericks, etc) are using SAMBA natively since Apple is no longer actively going to develop AFP. After upgrading all of my machines to Mavericks, I was able to get rid of AFP and now have all machines using SMB.