I want to know on the windows operating system, what is the port number for the file sharing service?

For example as you know the port number for HTTP service is 80. So I need to know the port number of file sharing protocol?


2 Answers 2


I've seen all of these..file sharing related

UDP-137, UDP-138, TCP-139,TCP-445

And possibly TCP port 135, though that may be something to do with something called "RPC" (source (archived)).

on an windows 7 machine all of those are listening. Some are related to NETBIOS so you can do start...\\compname

This site adds:

If the server has NBT enabled, it listens on UDP ports 137, 138, and on TCP ports 139, 445. If it has NBT disabled, it listens on TCP port 445 only.

And this site (archived) mentions:

"In Windows 2000/XP/2003, Microsoft added the possibility to run SMB directly over TCP/IP, without the extra layer of NetBT. For this they use TCP port 445. "

So in 2K,XP,2003...and I suppose Win 7,8, it is possible to run file sharing on only port 445 But you'd be doing start...\\ip rather than start..\\compname

  • 1
    @MaQleod en.wikipedia.org/wiki/Server_Message_Block SMB protocol, that page mentions those ports I listed.. and about authentication.
    – barlop
    Jun 6, 2014 at 20:28
  • It covers some of the possibilities, but not all. Windows is capable of NFS, SMB, FTP, SSH/SCP and many other file sharing protocols and authentication for these services can require more than just AD, such as LDAP or NIS. SMB/AD/Krb certainly is the most common use case, but OP never really clarified.
    – MaQleod
    Jun 8, 2014 at 0:52
  • 3
    @MaQleod The term "file sharing" is pretty well known to users of windows, and doesn't mean FTP or SSH. It's an option in Windows called "File Sharing". There are a multitude of expressions associated with it, such as turn file sharing on, or enable file sharing or make sure the firewall is allowing file sharing through. Maybe SMB is an even more technical term, but "windows file sharing" or "file sharing in windows", is specific assuming they are using their terminology correctly. It doesn't look like Win7 has a built in SSH server.
    – barlop
    Jun 8, 2014 at 1:50
  • 1
    @MaQleod He wasn't asking about every protocol, even non-native, that windows can possibly run, that allows sharing of files. and "file sharing" is what windows calls SMB. I'm not even sure whether/where windows calls "file sharing" SMB though indeed it is SMB. But 'file sharing' is thus a very correct term for it.
    – barlop
    Jun 8, 2014 at 1:51
  • 1
    @R.D.Alkire yes, see my last paragraph about only 445, And yes you can of course as you suggest, apply that to when you are configuring (that word you didn't mention but meant in that comment of yours),, a firewall.
    – barlop
    Sep 21, 2021 at 22:23

If file transfer is via FTP - TCP/21, in case of SFTP - TCP/22

  • 5
    in this case, it literally refers to "windows file sharing, aka smb/cifs
    – Journeyman Geek
    Feb 24, 2018 at 1:09

You must log in to answer this question.

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