Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

   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

    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!

share|improve this question
Did you smbpasswd -a stivlo? Have you tried using sudo? – Andrew May 6 '11 at 8:22
@Andrew No, I didn't. I thought the whole point of having "unix password sync = yes", is that you don't need separate users for Samba. Anyway, I tried, and it works. Thank you. I still wonder how to set up the user and password sync though. "sudo"? I use it for admin commands, or I run them as root, I don't get what you mean. – stivlo May 6 '11 at 8:38
The point of unix password sync is to ensure that when users change their Samba password, their Unix password gets changed automatically. Nothing more. – Mike Renfro May 6 '11 at 12:00
Interesting... however with my setup, I tried to change the samba password with "sudo smbpasswd stivlo", then I tried to login with SSH with the old password and it was still working. So not even this functionality is working for me. – stivlo May 6 '11 at 14:13

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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