Ubuntu – Samba: session setup failed: NT_STATUS_LOGON_FAILURE

sambaUbuntu

I tried to set up Samba with "unix password sync", but I still get logon failure. I am running Ubuntu Natty Narwhal.

$ smbclient -L localhost
Enter stivlo's password:
session setup failed: NT_STATUS_LOGON_FAILURE

Here is my /etc/samba/smb.conf

[global]
   workgroup = obliquid
   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 = true
   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

[www]
    path = /var/www
    browsable = yes
    read only = no
    create mask = 0755

After modifying I restarted the servers:

$ sudo restart smbd
$ sudo restart nmbd

However I still can't logon with my Unix username and password.

Can anyone please help? Thank you in advance!

Best Answer

As Andrew mentioned: sudo smbpasswd -a This command did the trick for me. Before that I used Webmin to browse samba users, and change my user password there, it did not work! To my experience, this NT_STATUS_LOGON_FAILURE error is very popular when I tried setup samba servers. The difficult thing is that there are many causes to give this same-boring-uninformative error message.