

Since the smb driver has been set up to not start on system startup, add a scheduled task to start it when anyone logs in:.Netsh interface portproxy add v4tov4 listenaddress=10.255.255.1 listenport=445 connectaddress=10.255.255.1 connectport=44445 Note the space between start= and demand.Įxecute the following command to reroute TCP port 445 to a port of your choice. Switch to the WINS tab, and select Disable NetBIOS over TCP/IP.ĭisable automatic starting of the smb driver by executing the following command:.Deselect Automatic metric and enter 9999 as Interface metric.Click on Advanced to open Advanced TCP/IP Settings.Enter a private IP address such as 10.255.255.1. The checkbox for Internet Protocol Version 4 must remain enabled.Disable the checkboxes Client for Microsoft Networks and File and Printer Sharing for Microsoft Networks.Open Properties for your loopback adapter.Configure the network adapter to disable Client for Microsoft Networks functionality, and give it an IP address:.Select manufacturer "Microsoft" and then adapter "Microsoft Loopback Adapter".Select "Install the hardware that I manually select from a list".You can do so through the Add Hardware Wizard: An easy way to obtain this additional adapter is by installing a Microsoft Loopback Adapter. You will need an additional (real or virtual) network adapter on which you can disable the Client for Microsoft Networks functionality.Note that all command lines shown below will require an elevated administrative Command Prompt.In the event that Jan's tutorial becomes unavailable, the following is a summary: Other boot-time tasks such as virus scanner updates also sometimes use SMB, and may fail. This may cause problems if your computer is joined to the domain, because Group Policy is distributed via SMB from the domain controller. Note: Following this tutorial will cause SMB to run much later after booting the computer. Jan's tutorial was written with PuTTY in mind, but the crucial steps will work identically with Bitvise SSH Client. If you would still like to port forward Windows file shares, you may be able to achieve this using an approach described by Jan Just Keijser in this tutorial. We recommend adapting your approach so that you can use SFTP or SCP for file transfer instead. In recent versions of Windows, including Vista, Windows 7, and 2008, setting up port forwarding of file shares over SSH is now considerably more difficult. We recommend finding a way to use SFTP access to the file share instead. The following is old information that we continue to provide only as a courtesy.

Changes in Windows design have made this usage scenario between difficult and impossible. We no longer support tunneling Windows file shares over SSH. It is instead about accessing Windows file shares - folders exposed to a local network using built-in Windows functionality - via SSH tunneling (port forwarding). This article is not about SFTP or SCP file transfer. Securing Windows File Shares with SSH Port Forwarding
