What ports need to be open for Samba to communicate with other windows/linux systems?

by nixcraft on July 29, 2006 · 2 comments

Q. What ports need to be open for Samba to communicate with other windows/linux systems? I need to configure Linux firewall so I need the exact port names.

A. You can get list of ports from file called /etc/services. For your ease of use here are ports you need to open for two-way samba communication with Windows and Linux desktop systems.

  • netbios-ns - 137/tcp # NETBIOS Name Service
  • netbios-dgm - 138/tcp # NETBIOS Datagram Service
  • netbios-ssn - 139/tcp # NETBIOS session service
  • microsoft-ds - 445/tcp # if you are using Active Directory

Other ports

  • Port 389 (TCP) - for LDAP (Active Directory Mode)
  • Port 445 (TCP) - NetBIOS was moved to 445 after 2000 and beyond, (CIFS)
  • Port 901 (TCP) - for SWAT service (not related to client communication)

See this url for Iptables rules for SAMBA/CIFS clients.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 2 comments… read them below or add one }

1 ZeldoR December 7, 2009

Thx. very much, nice overview :)

Reply

2 Scott February 22, 2011

One note:

Ports 137 and 138 are UDP for samba. Cheers,

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 4 + 4 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: