The firewall on my network drops all packets on TCP port 139 and 445. So all samba shares don't work outside the LAN.

I tried letting the samba daemon listen on a non-standard port. This method works well for linux, because both smbclient and smbmount has an option to set server port. But on windows I cannot find a similar option.

Does Windows support mounting smb shares on non-standard ports? Third-party softwares are also acceptable.


\\hostname:port\share in Windows explorer doesn't work. Strangely, I can see the connection is established on the server. But Windows keeps telling me that the server couldn't be reached. It doesn't work even in LAN with standard port 445, in which case a path without port number will get through.

  • Have you tried setting the port in the url? smb://myhost:555/my/path/to/share
    – Gjordis
    Jan 17, 2014 at 8:08
  • 2
    @Gjordis: Yes and it fails. See my edit.
    – hpsMouse
    Jan 17, 2014 at 8:39
  • In your case I would use a port redirector running on my local and on, and I would redirect them to your destination ip. But I think a VPN solution would be more feasible (for example, openvpn).
    – peterh
    Jan 24, 2018 at 11:01

2 Answers 2


Unfortunately, it is not possible as windows does only support ports 445 and 139

You might be able to use ssh tunneling. Here is a reference using windows and linux: https://www.ocf.berkeley.edu/~xuanluo/sshproxywin.html

  • Do you have a reference for the claim that Windows only supports 445 and 139? I don't doubt it, but it would be nice to see something official, if it exists.
    – Ben Mares
    Feb 18, 2020 at 11:55

For those who are still looking for a way to mount SMB resources on a non-standard port, here is a great article on how to do this. I personally set up stunnel to wrap SMB traffic with SSL, since I access my SMB shares remotely over the Internet. Works like a charm.

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.