Sunday, January 31, 2010

My samba server was losing/changing passwords !

I finally resolved a nagging problem with Samba. I recently installed Ubuntu 9.10 (Karmic Koala), and I was using pretty much the same config file for Samba that I was using with Ubuntu 8.04.

Passwords getting modified automatically ?
However, there was a problem. After a few hours, it seemed like the Samba passwords were replaced by the UNIX passwords. So I had to reissue a sudo smbpasswd <user> to set back my password. In my system, I don't use the same password for Samba and Unix. But somehow, the password was getting changed automatically after a few hours.

Obviously, I already had that option:
unix password sync = no
But that didn't do anything ! The password was still getting changed to UNIX.

Google is of no help
I tried Google/Bing searches but there are thousands of questions involving passwords and Samba, and after reading countless search results, nothing really matched by problem. I mean Google is a good search engine if you're looking for something popular since its core algorithm is a kind of popularity contest. But when you're looking for something rare that can only be expressed with common vocabulary, this search engine really shows its limits.

Read The Fucking Manual (RTFM)
So my last option was to start reading the Samba documentation, which is like reading an encyclopedia. I mean who really reads that enormous document ? What a pain !
But anyway, after a few days of browsing through it I finally figured the issue.

There's something about pam_smbpass
It was a Samba module named pam_smbpass that was installed automatically by Ubuntu. This module, every now and then would replace the Samba passwords with the UNIX passwords.

So I went to synaptic package manager and uninstalled that module. Problem solved.

1 comment:

  1. Hmm... That's why I don't like it, when some linux distributions install more stuff than actually needed...