How to mount a samba share on non-standard port?

16,605

Solution 1

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

Solution 2

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.

Share:
16,605

Related videos on Youtube

hpsMouse
Author by

hpsMouse

Updated on September 18, 2022

Comments

  • hpsMouse
    hpsMouse almost 2 years

    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.


    Edit:

    \\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.

  • Ben Mares
    Ben Mares over 4 years
    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.