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?


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". [1]

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

This site http://ntsecurity.nu/papers/port445/

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 http://www.petri.co.il/whats_port_445_in_w2k_xp_2003.htm 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] http://www.danielmiessler.com/writing/windowsfilesharing/

  • @MaQleod en.wikipedia.org/wiki/Server_Message_Block SMB protocol, that page mentions those ports I listed.. and about authentication. – barlop Jun 6 '14 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 '14 at 0:52
  • @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 '14 at 1:50
  • @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 '14 at 1:51

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.