Wednesday, October 04, 2006

Samba Server giving me the creeps

 Getting samba to work. Sometimes it so happens that you get everything done, you have samba.conf configured correctly and it still doesnt work. It was giving me timeouts when I tried to access my PC. In my case I installed webmin and a whole lot of other products so I dont know if any of those messed up with my system but the following should be of use hopefully if you are having windows problems.

My samba was giving me timeouts when I tried to. First of all you can analyse the socket connections on your PC using a command called netstat. (For those of you who are unfamiliar with grep, it is a simple pattern matcher. Just like find in the results)

Iqbal# netstat -an | grep 139
tcp4       0      0  *.139                  *.*                    LISTEN

My Samba server is listening here so it means that it must be working normally.

If this entry is missing, you need to make sure of the following things. First of all if the BSD packet filter is enabled or disabled

The following command is for disabling your packet filter.

Iqbal# pfctl -d
pfctl: pf not enabled


In case you want to leave it enabled, go into /etc/pf.conf and you can set it to allow all packets by uncommenting(or typing):-

pass in all #which in essence isnt far from disabling

or you can use an entry of the sort:-

#pass in on $ext_if proto {tcp, udp } all from any to $ext_if port 139 keep state     

Remember port 139 is the default listening port for samba servers.

If this is still not the problem, it is possible that your samba daemon (located @ /usr/sbin/smbd ) may not be starting.

Change to superuser by typing su, hitting enter and supplying your root password.

Once su, head run the smbd binary with the following usage:-

/usr/sbin/smbd -D

Now check if you can access yourself from Konquerer or using smbclient on Konsole.

This worked for me. However all does not end here. In order to autostart it, I placed the following two lines in rc.local :-

# Start Samba Server
/usr/local/sbin/smbd -D

Now your PC-BSD installation should autostart samba server automatically as it did for me.

inetd.conf can also be configured to start samba server by uncommenting the following two lines:-

netbios-ssn stream tcp  nowait          root    /usr/local/sbin/smbd    smbd
netbios-ns dgram udp    wait            root    /usr/local/sbin/nmbd    nmbd

However this approach although more elegant, wasnt working for me.

Note: Suggestions, comments and healthy criticism will be most appreciated. In fact I'm looking for people to help make this blog successful so I have no problem in sharing ownership.

Regards,

Iqbal Talaat Bhatti

0 Comments:

Post a Comment

<< Home