Changing smb ports to alternative port

Harsh Tiwari 20 Reputation points
2025-01-02T14:27:08.54+00:00

Hello team , We use windows 2012 R2 and windows 2019 servers in our environment . We have received recommendation to not use default ports 139 and 445 (SMB) . Can we use an alternative port in place of 139 and 445 for sql logshipping and network file transfer . Also if yes what is the procedure for changing port on windows 2012 r2 or windows 2019 standard

Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2025-01-02T14:46:50.8133333+00:00

    Hello.

    In Windows Server 2012 R2 and Windows Server 2019, ports 139 (used for session services for NetBIOS over TCP/IP) and 445 (used for Microsoft-DS over direct TCP/IP (i.e., SMB/CIFS)) are reserved for the SMB protocol.

    SQL Server Log Shipping relies on backup and restore operations between SQL Server database engines and does not normally use the SMB port directly for communication. It can transfer data in a variety of ways, including through network shares or through other transport mechanisms such as FTP, SCP, and so on. Therefore, if you are referring to the log sending feature of SQL Server, then changing the SMB port will not directly affect this feature, and you can choose a different method for transferring transaction log backup files.

    However, for network file transfers, the SMB protocol is used by default and its ports are fixed and cannot be easily changed. Microsoft does not officially support changing these ports because many system components and services rely on these default settings. Attempting to modify them may lead to unforeseen problems or compatibility issues.

    Best Regards,
    Hania Lian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.