I have samba server already running on standard ports(445 and 139). This samba server is integrated in Alfresco application. I need to setup new samba server but now I have problem with ports. Ok, so in my smb.conf I put this option

smb ports = 450 140

Restart samba

/etc/init.d/samba restart

I have

root@ubuntu:/etc/samba# netstat -na |grep 450
tcp        0      0   *               LISTEN

but how to connect to samba share folder from windows machine on port different then standard samba port?


This can't be done. Windows does not support TCP ports other than 445/139. Here is one reference.


use NAT

this can be done by applying some rule on your router/gateway

[windows]--139-->[dst-nat 139 to x.x.x.x:1139 router ]-->1139-->[samba-server listen on :1139]


I have tried different approach, and finally got the solution. Here's the approach:

  1. You need to close the local samba server first.
  • sc config lanmanserver start=disabled
  • sc stop lanmanserver
  • Reboot
  1. Use netsh interface command create a new port proxy for this ip. If your server ip is ipv6, you should use v4tov6, otherwise v4tov4. Here my example, assuming your service's port is 1139:

    netsh interface portproxy add v4tov6 listenport=445 connectaddress=[blah:blah:blah:blah] connectport=1139
  2. You are now able to connect to your samba server via \\

Wish you enjoy the solution!

New contributor
linzuojian is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.