Super User is a question and answer site for computer enthusiasts and power users. 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 built a new computer with the intention of it being primarily a home file server. I want Samba to use peer to peer networking using NTLM security and user-mode authentication. According to the documentation this is possible, but there are no examples that I could find. In all the googling I have done, I see a lot of people asking how to set this up but it either works for someone else and not for me (no idea what I'm missing), or it doesn't work.

Here is my setup:

  • one desktop with Windows 7 64 HP
  • one laptop with Windows 7 64 HP
  • one desktop with Kubuntu 11.10 (server)
  • The two desktops use static IPs, and I have hostnames mapped in the HOSTS files on all three systems.
  • I have the same username/password combo on all three systems.

I have been trying for a while now to set up Samba so the Windows 7 systems can see and use it. Even if I can get the server to show up, Windows is unable to log in.

One of the first things I did was to enable LMv2 authentication, which this version of Samba (3.5.11) supports. The workgroup is set correctly. I can normally see the server, but cannot authenticate. Windows homegroup is turned off. Pinging between machines works fine, and the two Windows 7 systems work together flawlessly.

Has anyone gotten this to work? Is there a place I could download a smb.conf that is set up to work in this environment?

Edit: here is a link to the entire smb.conf as it currently stands. Please note that it's probably a mess by this point with all the editing I've done. Here is a condensed version of the [global] section as well.

workgroup = WORKGROUP
netbios name = DENTALFLAW
server string = %h server (Samba, Ubuntu)
dns proxy = no
interfaces = eth0
bind interfaces only = yes
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 = guest
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
client ntlmv2 auth = yes
usershare allow guests = yes

I don't really want to answer my own question but I want this to be useful to others who have tried (almost) everything and gotten nowhere. The specific setting where the default did not work was:

passdb backend = guest

Once I changed this to the following, and reset Samba passwords for both users, everything just started working:

passdb backend = tdbsam

It appears that the issue preventing me from logging in was that Samba was unable to store authentication information in a valid format.

share|improve this question
Check /var/log/log.nmbd and /var/log/log.smbd for some hints on what might be going wrong. – Randolf Richardson Nov 12 '11 at 2:00
(My "upvote" button doesn't work. I'm not sure why. I'll try to upvote your question later.) – Randolf Richardson Nov 12 '11 at 2:02
Could you post your [global] section from smb.conf? – Paul Nov 12 '11 at 2:11
Posted. Please see the edit at the end of my post. I also posted a link to the entire config. – Snowman Nov 12 '11 at 5:04
Have you added the users to the Samba user database using the smbpasswd utility? – jelmer Nov 12 '11 at 15:16

From your description, I'm not exactly sure where the problem is. If you are can connect and the server asks for a login, and the login fails... You need to setup a smbpasswd set for the user you are trying to use, there is a bug with windows 7/samba that has to do with hostnames There is a fix, and after applying everything works.

Registry key/fix for samaba windows 7 bug.

share|improve this answer
It would be much more helpful and interesting if you described exactly what your solution does, rather than just linking to your own website. – sblair Nov 12 '11 at 2:40
My problem is "it doesn't work." At first I could see the Samba server but not authenticate, now after tweaking settings per the Samba documentation, I can't even see the server (but ping works). What I am asking for is a configuration to make this work, since the google research I have done has come up inconclusive. Aside from that, help poring through my smb.conf (edited into the question now) would also be appreciated. While not a Linux noobie, I am not experienced enough to tackle this one myself. – Snowman Nov 12 '11 at 4:55
My registry patch Changes the windows hostname when you try to login to samba from the actual hostname of your computer to domain.local. Say your computer's name is Sparky, and your server's name is Gator. Before the patch Samaba sees a connection from *user*@Sparky This isn't a valid user. but it will accept a connection from *user*@Gator. bye applying the patch Samba sees *user*@localhost, and since localhost is Gator, it accepts the connection. Resetting your smb.conf to the point where you saw it but couldn't authenticate then applying this registry key should fix the problem. – ntw1103 Nov 13 '11 at 20:41
up vote 0 down vote accepted

The authentication backend was incorrect:

passdb backend = tdbsam

It appears that the issue preventing me from logging in was that Samba was unable to store authentication information in a valid format.

share|improve this answer

You must log in to answer this question.

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