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 am trying to debug a samba share problem with ubuntu 9.10.

Ubuntu 9.10 shares a folder, try to access from WinXP. WinXP can't see the folder.

Use netstat -anp command I found that smbd is only accept socket connection on 139 on tcp6 but not in tcp. (IPv4). Do anyone know if this is the cause the my connection problem? If so, how to fix this?

On the working samba share system (FC11), I can see the smbd is waiting in tcp port 139 and not in tcp6.


root@tlee-vm:~# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0    *               LISTEN      1024/sshd
tcp        0      0 *               LISTEN      1281/cupsd
tcp       16      0        ESTABLISHED 3647/gvfsd-smb
tcp       24      0           ESTABLISHED 3677/gvfsd-smb-brow
tcp        0      0       ESTABLISHED 3953/sshd: tlee [pr
tcp6       0      0 :::139                  :::*                    LISTEN      3104/smbd
tcp6       0      0 :::22                   :::*                    LISTEN      1024/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      1281/cupsd
tcp6       0      0 :::445                  :::*                    LISTEN      3104/smbd
tcp6       0      0          ESTABLISHED 3679/smbd
udp        0      0 *                           891/avahi-daemon: r
udp        0      0  *                           891/avahi-daemon: r
udp        0      0*                           3100/nmbd
udp        0      0*                           3100/nmbd
udp        0      0   *                           3100/nmbd
udp        0      0*                           3100/nmbd
udp        0      0*                           3100/nmbd
udp        0      0   *                           3100/nmbd
share|improve this question
is samba binding to the interfaces properly? please include your samba config (smb.conf) so we can troubleshoot. – quack quixote Dec 22 '09 at 18:41
up vote 2 down vote accepted

You had to run smbpasswd to add the user password because Samba doesn't automatically copy the Unix passwords into its password backend.

See man smb.conf for specifics on each smb.conf parameter. The unix password sync option doesn't replace Samba's password backend with the system password subsystem. It augments it by allowing your passwd program to run when the smbpasswd is changed. Here's the specifics from the manpage (emphasis mine).

This boolean parameter controls whether Samba attempts to synchronize the UNIX password with the SMB password when the encrypted SMB password in the smbpasswd file is changed. If this is set to yes the program specified in the passwd program parameter is called AS ROOT - to allow the new UNIX password to be set without access to the old UNIX password (as the SMB password change code has no access to the old password cleartext, only the new).

Default: unix password sync = no

share|improve this answer
Thanks a lot. That explains it for me. – tony-p-lee Dec 23 '09 at 21:35

Got it working by:

Disable the ipv6 in Ubuntu: (Not sure if I need this step, but I don't need ipv6 anyway and not sure why samba is not binding the ipv4 port)

vi /etc/sysct.conf # and add following line; reboot

Use the smbpasswd to add the password for the user that need the login, I am not sure why this is needed, since my /etc/samba/smb.conf file has "unix password sync = yes" line in it.

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* .

BTW, if someone can tell me why I need to use smbpasswd to add the user password to the system, I will mark that as the answer.

share|improve this answer

I just had to debug a problem connecting to a samba share on Ubuntu 9.10 from Windows XP, and I found this description of setting up samba helpful, along with this samba troubleshooting guide.

In case you're curious, my firewall on Ubuntu was blocking access. I allowed access on port 445, and it started working.

sudo ufw allow 445
share|improve this answer

sudo ufw allow 445

This worked for me. Thanks!

P.S. They need to sort this out. A new linux user would never be able to figure this out!

share|improve this answer

You must log in to answer this question.

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