Samba Tips

Hello, in this page we show few tips for samba.

Q: How to force the master browser to re-run?
A: Run next command

# smbcontrol nmbd force-election

Q: How do we find out who the master browser is in the network ?
A: Run next command

 # nmblookup -M -- -
querying __MSBROWSE__ on 192.168.1.255
192.168.1.130 __MSBROWSE__
192.168.1.1 __MSBROWSE__
192.168.1.22 __MSBROWSE__
192.168.1.66 __MSBROWSE__

In this case I found some master computer browser.
Q: How do you know the name of netbios if you know IP address ?
A: Run next command

# nmblookup -A 192.168.3.28
Looking up status of 192.168.3.28
        OTL-DEPOZIT-2   -         B 
        OTL           -  B 
        OTL-DEPOZIT-2   -         B 
        OTL           -  B 

        MAC Address = 50-E5-49-90-E2-03

Q: And vice versa ?
A: See next

nmblookup -S OTL-DEPOZIT-2
querying ORSH-DEPOZIT-2 on 192.168.3.255
192.168.3.28 OTL-DEPOZIT-2
Looking up status of 192.168.3.28
        OTL-DEPOZIT-2   -         B 
        OTL           -  B 
        OTL-DEPOZIT-2   -         B 
        OTL           -  B 

        MAC Address = 50-E5-49-90-E2-03

Other userful command, smbtree, smbstatus.

NOTE: If you do not have any of the above packages installed, ensure that the samba-client is installed.

Enjoy.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 4 =


This site uses Akismet to reduce spam. Learn how your comment data is processed.